1

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

Phil
  • 47
  • 9

1 Answers1

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).

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • I tried it, but I still need the dll in the Visual Studio folder too. The dll is in the Extension Folder (also if I just use the reference), so I do not need to include it in VSIX. I don't know why it Needs the referenced dll in the Visual Studio folder. Why is the extension using the dll from the Visual Studio folder and not the dll from the extension folder? – Phil Aug 24 '18 at 05:25
  • @Phil, As you said that you have add the reference, but it still find the dll file from the VS folder, one possible reason is that this dll file was the dependent dll from other assembly, you need to check that whether you forget to install certain packages, for example, System.Windows.Interactivity.dll was included in the blend SDK:https://stackoverflow.com/questions/8360209/how-to-add-system-windows-interactivity-to-project, or you could deploy them to the GAC: https://stackoverflow.com/questions/13674782/vsix-cannot-load-file-or-assembly-of-a-referenced-dll – Jack Zhai Sep 01 '18 at 02:23
  • @Phil, You are welcome, if it is helpful for you, I will post it as an answer. If not, feel free to let me know, so we could discuss it together. Have a nice day:) – Jack Zhai Sep 03 '18 at 09:48