简体   繁体   English

如何解决 VSIX -Visual Studio 扩展项目中 Azure.Core.dll 的参考?

[英]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.我有一段代码将文件上传到 Azure 存储。 To do this I had to add Azure.Core dll in reference, and dependent assemblies.为此,我必须在参考中添加Azure.Core dll 和相关程序集。 This code works fine in a standalone WPF application.此代码在独立的 WPF 应用程序中运行良好。 In the visual studio Extension project, it throws this error-在 Visual Studio 扩展项目中,它抛出了这个错误——

Could not load file or assembly 'Azure.Core, Version=1.2.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies.无法加载文件或程序集“Azure.Core,Version=1.2.2.0,Culture=neutral,PublicKeyToken=92742159e12e44c8”或其依赖项之一。 The system cannot find the file specified.该系统找不到指定的文件。

My code is referencing to 1.3 version.我的代码引用的是 1.3 版本。

Steps that I followed are -我遵循的步骤是 -

  1. Added the dlls as references添加了 dll 作为参考

  2. Added the dllls in the RefAssemblies folder在 RefAssemblies 文件夹中添加了 dll

  3. Marked Copy Always and Include in VSIX as true.将“始终复制”和“包含在 VSIX 中”标记为 true。

  4. Mentioned dll version in app.config app.config中提到了 dll 版本

     <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 ?为什么扩展项目正在寻找 1.2.2 版本dll

As the error says, please install Azure.Core version 1.2.2.0 :如错误所示,请安装Azure.Core版本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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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