类型“xxx”在未引用的程序集中定义

问题描述 投票:0回答:2

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

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

Visual Studio 2015 错误

Visual Studio 2015 error

DLL文件版本

DLL file version

删除并添加了DLL文件,卸载并重新加载了项目,但还是不行。

c# vb.net visual-studio visual-studio-2015
2个回答
0
投票

你应该可以使用 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>

0
投票

试试这个:

  1. 在解决方案资源管理器中右键单击项目并选择属性。
  2. 转到“应用程序”选项卡并选择“组装信息”。
  3. 在程序集信息对话框中,在程序集版本文本框中输入新版本号。
  4. 点击确定。
  5. 构建项目以应用更改。
© www.soinside.com 2019 - 2024. All rights reserved.