简体   繁体   中英

How to resolve reference for Azure.Core.dll in VSIX -Visual Studio Extension project?

I have a piece of code that uploads a file to Azure storage. To do this I had to add Azure.Core dll in reference, and dependent assemblies. This code works fine in a standalone WPF application. In the visual studio Extension project, it throws this error-

Could not load file or assembly 'Azure.Core, Version=1.2.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies. The system cannot find the file specified.

My code is referencing to 1.3 version.

Steps that I followed are -

  1. Added the dlls as references

  2. Added the dllls in the RefAssemblies folder

  3. Marked Copy Always and Include in VSIX as true.

  4. Mentioned dll version in app.config

     <dependentAssembly> <assemblyIdentity name="Azure.Core" publicKeyToken="92742159e12e44c8" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> </dependentAssembly>

Why the extension project is looking for 1.2.2 version dll ?

As the error says, please install Azure.Core version 1.2.2.0 :

<dependentAssembly>
     <assemblyIdentity name="Azure.Core" publicKeyToken="92742159e12e44c8" culture="neutral" />
     <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
   </dependentAssembly>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM