1

I'm creating a Visual Studio Extension. This is a VSIX project.

I've added a reference to the project which I installed using NuGet.

At runtime, however, an error message is thrown. Cannot find file.... [name of dll].

What I would like to do is try and manually install this dll to the reference path that Visual Studio uses, so that it can resolve correctly.

JL.
  • 78,954
  • 126
  • 311
  • 459
  • Also check [this](https://stackoverflow.com/questions/13674782/vsix-cannot-load-file-or-assembly-of-a-referenced-dll?noredirect=1&lq=1) – vik_78 May 28 '19 at 12:40

1 Answers1

1

Looks like your problem is very similar to this

But also there is a solution what we are using in our extensions. You can create your own installer and move all necessary files into your specific folder. For this behavior you need to specify full path to your main integration dll in pkgdef

"CodeBase"="C:\Program Files (x86)\CompanyName\ProductName\integration.dll"

and vsixmanifest

<Asset Type="Microsoft.VisualStudio.MefComponent" Path="C:\Program Files (x86)\CompanyName\ProductName\integration.dll" />

files.

For VS2019 Community pkgdef and vsixmanifest should be placed here c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\

Subscribe on AppDomain.CurrentDomain.AssemblyResolve. Wait when specific assembly with specific version! required - and load it from your folder (C:\Program Files (x86)\CompanyName\ProductName).

vik_78
  • 1,107
  • 2
  • 13
  • 20