1

我正在为 VS2010 构建自己的扩展,它必须部署在 Visual Studio Gallery 之外。我的 NSIS 安装程序在安装软件的其他部分方面做得很好,但是我不知道如何安装 .vsix 扩展名。

我尝试通过作为 Visual Studio 一部分的 VsixInstaller.exe 执行此操作,但是它不允许为机器上找到的任何 VIsual Studio 静默安装扩展,并在安装程序中获取正确的错误代码。

“VsixInstaller.exe /quiet extension.vsix”无论发生什么都会返回 0 错误代码,并且需要 /skuName 和 /skuVersion 来自动检测。

我可以以某种方式手动执行此操作吗?例如,ReSharper 将所有扩展二进制文件保存在它的“Program Files”文件夹中,并以某种方式使它们可用于 VIsual Studio。

4

2 回答 2

0

Registering Visual Studio extensions is complicated process. For pre 2010 VS editions you need to copy appropriate files (.dll/.zip template/.regpkg...) into some folder and then write keys into registry with paths, settings, etc. (many, many keys).

These keys/settings are based on extension you are developing (LanguageService, Package, Add-in, ...)

After 2010 VS editions have new feature - .vsix extensions which is simple .zip archive containing all required files and registry keys.

You need to copy this .vsix file into some folder (recommended is inside VS install directory or other known folder as %VSInstallDir%\\) and then setup VS to load it (like running devenv.com /setup)

Read this blog for more info about discovering VS extensions: http://blogs.msdn.com/b/visualstudio/archive/2010/02/19/how-vsix-extensions-are-discovered-and-loaded-in-vs-2010.aspx

于 2012-06-28T14:41:13.890 回答
0

您是否尝试过使用 copy aka:

copy xx.vsix "%APPDATA%\Microsoft\VisualStudio\10.0\Extensions"

或者

copy xx.vsix %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft"
于 2012-06-28T08:25:52.410 回答