【问题标题】:How to resolve reference for Azure.Core.dll in VSIX -Visual Studio Extension project?如何解决 VSIX -Visual Studio 扩展项目中 Azure.Core.dll 的引用?
【发布时间】:2023-03-23 19:45:02
【问题描述】:

我有一段代码可以将文件上传到 Azure 存储。为此,我必须在引用和依赖程序集中添加Azure.Core dll。此代码在独立的 WPF 应用程序中运行良好。在Visual Studio Extension项目中,它抛出了这个错误-

无法加载文件或程序集“Azure.Core, Version=1.2.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8”或其依赖项之一。系统找不到指定的文件。

我的代码引用的是 1.3 版本。

我遵循的步骤是 -

  1. 添加 dll 作为参考

  2. 在 RefAssemblies 文件夹中添加了 dllls

  3. 在 VSIX 中始终将副本标记为 true。

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

为什么扩展项目要找1.2.2版本dll

【问题讨论】:

    标签: c# azure roslyn visual-studio-extensions vsix


    【解决方案1】:

    如错误所说,请安装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>
    

    【讨论】:

    • 我无法添加 1.2.2.0,因为所有其他项目都引用了更高版本的 1.3
    • 似乎其中一个项目需要 1.2.2.0,您必须为所有项目降级到此版本。
    • 有没有其他方法可以解决这个问题?
    • 请将您所有项目的版本降级到 1.2.2.0,它应该可以工作。
    猜你喜欢
    • 2021-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多