VSIX extension - Change Path of DLL

对着背影说爱祢 提交于 2020-01-14 02:53:14

问题


I've created a Visual Studio Extension (VSIX) with Visual Studio 2013. In this extension I have a reference to another class library (DLL) which I created.

This DLL will be placed in the extension Folder correctly after installing the extension Extension Folder is C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\1oqfh4o4.2y5\

But I need this dll also in the installing directory of the Visual Studio -> C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE

If I do not copy the dll into the Visual Studio folder I get an exception that the extension cannot find the dll.

Is it possible to change the path of the dll to the extension folder? Is it possible to include the dll directly to the VSIX?

I tried it with the "Assets" in the "source.extension.vsixmanifest" but it's still not working.

I also have the same problem with an external library "System.Windows.Interactivity.dll"

Thanks, Phil


回答1:


Is it possible to include the dll directly to the VSIX?

Yes, but you should make sure that the dll is redistributable.

  • Add the dll to your extension project as file instead of reference(Add->Existing Item).
  • Set its property "Build action" to Content on the Properties window.
  • Set its property "Include in VSIX" to True on the Properties window.

Then build the extension project, you can check the dll file in the .vsix file (Rename the .vsix file to .vsix.zip file and open it to check).



来源:https://stackoverflow.com/questions/51963717/vsix-extension-change-path-of-dll

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