SQL Server Management Studio 18 RC1 于2018年3月28日可用
SQL Server Management Studio 18 RC1 became available March 28, 2018
对于SSMS 17,已经针对该问题提出了此问题,但是在编写不同版本的SQL的扩展时会有一些细微的差异服务器管理Studio.
This question has already been asked for SSMS 17, but there are slight variations when authoring extensions for different releases of SQL Server Management Studio.
如何使Hello World应用程序在SSMS 2019中运行?
推荐答案以下是完整的步骤,改编自Stefan Timovski在如何创建SQL Server Management Studio 18(SSMS)扩展
Here are the complete steps, adapted from Stefan Timovski's article on How to Create SQL Server Management Studio 18 (SSMS) Extension
使用扩展工具包安装 Visual Studio 2017 >
Install Visual Studio 2017 with Extensions Toolkit
如果不确定是否具有扩展工具包,则可以打开Visual Studio安装程序并修改当前安装以确保已安装扩展.
If you're not sure you have the extensions toolkit, you can open the Visual Studio Installer and modify your current install to make sure you have extensions installed
创建新的扩展项目
转到文件新项目( Ctrl + Shift + N )
Go to File New Project (Ctrl + Shift + N)
选择可扩展性> VIX项目
Choose Extensibility > VIX Project
如果没有这些选项,请确保已执行步骤1
If you don't have these options, go make sure you did step 1
添加新命令项
添加新项( Ctrl + Shift + A )
Add a new item (Ctrl + Shift + A)
选择可扩展性,仅出于演示目的,抓住自定义命令
Select Extensibility and just for demo purposes grab a custom command
在Visual Studio中调试
命令文件将在工具">调用 Command1 "中添加一个菜单项.如果您点击调试,Visual Studio将启动一个Debuggable实例,该实例已满载您当前的扩展名.点击播放或点击 F5
The command file will add a menu item to Tools > Invoke Command1. If you hit debug, Visual Studio will launch a Debuggable instance, fully loaded with your current extension. Hit play or hit F5
第一次启动可能需要一分钟时间,但是此后它应该会更快
The first time may take a minute to boot-up, but it should go faster thereafter
在 Command1 .cs> Execute中处理的单击事件,您可以添加断点.
The click event handled in located in Command1.cs > Execute, and you can add breakpoints.
这是工作消息框
获取SSMS的文件路径
SSMS 18的默认安装路径应为:
The default installation path for SSMS 18 should be:
C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe如果不存在,请使用 Shift +右键单击该应用程序图标,然后选择打开文件位置",以标识任何应用程序的启动位置.
If it's not there, to identify the startup location of any app, you can Shift + Right Clicking on the app icon and select "Open file location"
将启动设置为SSMS
在VS中打开项目属性( Alt + Enter )
Open up the project properties in VS (Alt + Enter)
转到调试> 启动外部程序并粘贴路径
删除命令行参数,因为它们不再适用于SSMS
Remove the command line args as they're no longer applicable to SSMS
设置将VSIX部署到SSMS
扩展名"子目录应与SSMS位于同一目录中.另外,添加一个像您这样的项目名称的额外文件夹
The "Extensions" subdirectory should be in the same directory as SSMS. Also, add an extra folder with your project name like this
C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\VSIXProject1转到 VSIX >,然后选择"将VSIX内容复制到以下位置"
Go to VSIX > and select "Copy VSIX content to the following location"
设置权限
最后,为了以编程方式调用C Drive上的任何应用程序,您将需要管理员权限,因此需要在管理员模式"下打开Visual Studio.您可以通过右键单击像这样的应用程序来做到这一点
Lastly, in order to programmatically invoke any apps on C Drive, you'll need admin privileges, so you need to open Visual Studio in Admin Mode. You can do that by right clicking on the application like this
命中运行&调试
Presto!布拉莫!您的扩展程序现在应该正在运行SSMS
Presto! Blamo! Your extension should now be running SSMS
进一步阅读
从历史上看,每个扩展都需要列入白名单,但是根据 SSMS 18发行说明,其中一个较大的变化(更好)是
Further Reading
Historically, each extension needed to be whitelisted, but according to the release notes for SSMS 18, one big change (for the better) is
开发SSMS扩展不再需要软件包ID 过去,SSMS仅选择性地加载知名软件包,因此要求开发人员注册自己的软件包.情况不再如此.
Package IDs no longer needed to develop SSMS Extensions In the past, SSMS was selectively loading only well-known packages, thus requiring developers to register their own package. This is no longer the case.
由于SSMS 18使用 Visual Studio 2017隔离外壳,因此许多扩展开发人员文档位于 Visual Studio扩展文档
Since SSMS 18 uses the Visual Studio 2017 Isolated Shell, many of the extension developer documentation is available under the Visual Studio Extension Docs
更多推荐
如何为SSMS 2019(v18)创建扩展
发布评论