如何在 VS2017 中用 C# 为 SQL Server Management Studio 17 创建扩展? [英] How to create extension for SQL Server Management Studio 17 in C# in VS2017?

查看:33
本文介绍了如何在 VS2017 中用 C# 为 SQL Server Management Studio 17 创建扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了来自 创建您的第一个扩展的简单 Hello World 示例:来自 Microsoft Docs 的 Hello World 示例,用于为 SSMS 2017 构建扩展

I followed simple Hello World sample from Create your first extension: Hello World example from the Microsoft Docs to build an extension for SSMS 2017

  1. 从可扩展性项目模板创建 VSIX 项目

  1. Created VSIX project from Extensibility project template

将项目">属性">调试"中的启动外部程序"更改为
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe

Changed "Start External Program" in Project > Properties > Debug to
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe

在命令行参数中添加 -S (localdb)\MSSQLLocalDB -d sampleDB -E 作为
它需要指定服务器名/数据库才能运行 SSMS.exe.

Add -S (localdb)\MSSQLLocalDB -d sampleDB -E in command line arguments as
it requires servername/database be specified to run SSMS.exe.

如果步骤 #2 &#3 未执行,它在 Visual Studio 中运行良好,但是 SSMS 没有任何反应,尽管它启动了 SSMS.

If step #2 & #3 is not performed, it works fine with Visual Studio, however nothing happens with SSMS, though it launches SSMS.

我是不是遗漏了什么,或者为 SSMS 创建加载项有什么限制?

DId I missing something or is there any restriction for creating add-in for SSMS?

推荐答案

你说对了第一点,但在开始之前还有几个步骤要做:

You got the first bit right, but there are a couple more steps to do before you’re set:

  1. 您需要告诉 Visual Studio 将扩展(在构建时)复制到SSMS 扩展文件夹,以便 SSMS 可以在启动时加载它
  2. 您需要告诉 SSMS 跳过其内部扩展验证因为它不会加载任何未列入白名单的扩展SSMS 团队.

我在 CodeProject 上创建的一篇文章中详细解释了这个过程.您可以在以下链接中找到完整的教程:https://www.codeproject.com/Articles/1243356/Create-Your-Own-SQL-Server-Management-Studio-SSMS

I explained this process in detail in an article I created at CodeProject. You can find the full tutorial at the following link: https://www.codeproject.com/Articles/1243356/Create-Your-Own-SQL-Server-Management-Studio-SSMS

这篇关于如何在 VS2017 中用 C# 为 SQL Server Management Studio 17 创建扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆