Visual Studio 扩展 (VSPackage) 在所有实验实例中运行,但在作为 .vsix 安装后不会运行,除了在 VS2010 中 [英] Visual Studio Extension (VSPackage) runs in all Experimental Instances, but does not run after being installed as a .vsix, except in VS2010

查看:61
本文介绍了Visual Studio 扩展 (VSPackage) 在所有实验实例中运行,但在作为 .vsix 安装后不会运行,除了在 VS2010 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个面向 VS2010、VS2012 和 VS2013 的 Visual Studio 扩展.它在每个实验实例中运行并成功初始化,没有任何问题.当我安装构建生成的 VSIX 时,它安装在所有版本中都没有问题,但只有在 VS2010 中它才真正执行.在其他情况下,它从未实例化或初始化.

I am writing a Visual Studio extension which targets VS2010, VS2012, and VS2013. It runs and is initialized successfully in each Experimental Instance with no issues. When I install the VSIX generated by the build, it installs in all versions without a problem, but only in VS2010 does it actually execute. In the others it's never instantiated or initialized.

没有抛出异常.运行带有/log 标志的非实验性实例不会产生任何其他诊断信息(除了确认它已安装,并且具有比库中已有的对应版本更新的版本.)

There are no exceptions being thrown. Running the non-Experimental instance with the /log flag does not produce any other diagnostic information (other than confirming it is installed, and has a newer version than its counterpart already in the gallery.)

我的阅读和经验表明这是由于某种缺少组装或参考,但我无法确认.我也不知道如何找出丢失的东西,尤其是没有异常或日志消息.

My reading and experiences suggest that this is due to some sort of missing assembly or reference, but I can't confirm that. I am also at a loss as how one would figure out what's missing, especially without an exception or log message.

我已经在这几天尝试了一些事情,例如签署我的程序集、各种 vsixmanifest 更改、更改所需的框架版本,以及在 SO 上发现的许多其他没有成果的事情.

I've been at this for several days now trying things like signing my assemblies, various vsixmanifest changes, changing the required framework versions, and many other things found here on SO that have not been fruitful.

此外,我尝试从 VS Gallery 安装已发布的旧版本,但它也无法运行.但是,我收到了几个人的反馈(错误和感谢),所以我知道它适用于某些人.我没有收到任何反馈说没有发生任何事情",但不排除这些未报告的事实.

Additionally, I have tried installing the old, already published version from the VS Gallery, and it also does not run. However, I have received feedback (bugs and thanks) from several individuals, so I know it works for some people. I have not received any feedback stating that "nothing happens," but do not rule out the fact that those are unreported.

我不打算插,但目前发布的版本在这里:http:///visualstudiogallery.msdn.microsoft.com/5cc44f63-4ea8-4c17-8aa4-95037a2d32ef

I don't intend to plug, but the currently published version is here: http://visualstudiogallery.msdn.microsoft.com/5cc44f63-4ea8-4c17-8aa4-95037a2d32ef

我目前所处位置的完整源代码可以在 github 的ForStackOverflow"分支中找到.它和 master 之间的区别是一个 TraceAppender,我用它来确认 VSPackage 没有被实例化.https://github.com/alexcpendleton/Pendletron.Vsix.LocateInTFS/tree/ForStackOverflow

The entire source for where I currently stand can be found on github in branch "ForStackOverflow". The difference between that and master is a TraceAppender which I used to confirm that the VSPackage was not being instantiated. https://github.com/alexcpendleton/Pendletron.Vsix.LocateInTFS/tree/ForStackOverflow

任何建议、经验或任何事情都会有所帮助.谢谢.

Any suggestions, experiences, or anything would be helpful. Thank you.

推荐答案

感谢 Erti-Chris Eelmaa 关于启用 FusionLog 的建议,我能够弄清楚发生了什么.

Thanks to Erti-Chris Eelmaa's suggestion to enable FusionLog I was able to figure out what was going on.

Visual Studio 没有在已安装扩展的目录中查找我的扩展,而是从 GAC 和其他地方查找.奇怪的是,它找到了一个包含的程序集就好了.

Visual Studio was not looking for my extension in the installed extension's directory, rather from the GAC and elsewhere. Curiously, it was finding an included assembly just fine.

我检查了其他扩展的 .vsixmanifest,发现我的项目缺少一个 .pkgdef 内容节点.这似乎是 VS2010 的原因,或者由于某些其他原因碰巧在扩展的安装目录中查找包程序集,而 2012 和 2013 则没有.将此内容节点添加到我的 .vsixmanifest 允许 Visual Studio 加载和运行扩展.

I examined the .vsixmanifest of other extensions and discovered that mine was missing a .pkgdef Content node for my project. It would seem VS2010 accounts for this, or for some other reason happened to look in the extension's installation directory for the package assembly, where 2012 and 2013 did not. Adding this content node to my .vsixmanifest allowed Visual Studio to load and run the extension.

<Content>
  <VsPackage>Pendletron.Vsix.LocateInTFS.pkgdef</VsPackage>
</Content>

这篇关于Visual Studio 扩展 (VSPackage) 在所有实验实例中运行,但在作为 .vsix 安装后不会运行,除了在 VS2010 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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