【问题标题】:The type 'xxx' is defined in an asembly that is not referenced类型 \'xxx\' 在未引用的程序集中定义
【发布时间】:2023-02-17 05:23:28
【问题描述】:

由于我最近将一个自定义 DLL 文件更新为版本 1.0.3483.0,当我将该 DLL 文件包含在项目中时,它需要版本 1.0.3478。

为了更新项目中的 DLL 文件,我需要遵循哪些步骤?

视觉工作室 2015 错误

DLL文件版本

删除并添加了DLL文件,卸载并重新加载了项目,但仍然不起作用。

【问题讨论】:

标签: c# vb.net visual-studio visual-studio-2015


【解决方案1】:

你应该可以使用bindingRedirect来使用指定的版本。

例如:

<configuration>
    <runtime>
       <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
             <assemblyIdentity name="myAssembly"
                               publicKeyToken="32ab4ba45e0a69a1"
                               culture="neutral" />
             <bindingRedirect oldVersion="1.0.0.0"
                              newVersion="2.0.0.0"/>
          </dependentAssembly>
       </assemblyBinding>
    </runtime>
</configuration>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-16
    • 2014-08-15
    • 2016-05-01
    • 2018-01-10
    • 1970-01-01
    • 1970-01-01
    • 2023-03-28
    相关资源
    最近更新 更多