Visual Studio Extensions - support multiple versions of VS

随声附和 提交于 2019-12-12 14:37:10

问题


I've been writing an extension (Editor Classifier project, with some other features chipped in. It works fine on VS2013, but I need to support other versions VS2012 and VS2015(when it is out of Preview).

When I just add supported versions in the vsixmanifest, the problem that I'm facing is, the export of ITestContainerDiscoverer or IClassificationTypeRegistryService fails complaining

ContractName="Microsoft.VisualStudio.Text.Classification.IClassificationTypeRegistryService")' is not assignable to type 'Microsoft.VisualStudio.Text.Classification.IClassificationTypeRegistryService'

My guess is that this is because I am referencing invalid SDK versions. I could always write different versions, but is there a way to share an extension across versions of visual studio?


回答1:


@ErikEJ's tip worked for me. I had to port the extension project to VS2012 and build it with target set to [11.0,12.0] and this ensured that the VSIX that I generated worked for both VS2012 and VS2013. No errors too!



来源:https://stackoverflow.com/questions/27419585/visual-studio-extensions-support-multiple-versions-of-vs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!