如何在 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
从可扩展性项目模板创建 VSIX 项目
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 toC:\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  未执行,它在 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:
- 您需要告诉 Visual Studio 将扩展(在构建时)复制到SSMS 扩展文件夹,以便 SSMS 可以在启动时加载它
- 您需要告诉 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