【发布时间】:2021-06-27 19:38:01
【问题描述】:
我有许多生成 dll 的项目和一个生成可执行文件的主项目,今天我成功编译了这些项目,但是当我尝试启动主项目时,我第一次遇到了下一个异常:“Assembly manifest definition does不匹配程序集引用”,所以不是我第一次重新编译项目并执行主项目没有问题,但现在我收到了这个错误。
检查异常后,我可以在导致它的 app.config 中找到“bindingredirect”,我检查了旧版本的系统,问题是这个“bindignredirect”始终存在于 app.config 中,但是以前从未抛出此错误,如果我评论 bindingredirect 行,则主项目开始时没有问题。
所有项目都将 .net 3.5 作为目标 .net 版本,这是什么原因造成的?有什么改变可以让 bindingredirect 现在执行?
App.config 部分
<!-- Habilita el debug just-in-time. -->
<system.windows.forms jitDebugging="true" />
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Componentes" publicKeyToken="BB48DC83EB7CD949" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.1.17726" newVersion="1.0.1.17261" />
</dependentAssembly>
</assemblyBinding>
</runtime>
InnerException的FusionLog
=== Información de estado anterior al enlace ===
LOG: Usuario = ymora
LOG: DisplayName = Componentes, Version=1.0.1.17265, Culture=neutral, PublicKeyToken=bb48dc83eb7cd949
(Fully-specified)
LOG: Appbase = file:///E:/Yerald Mora/Documents/SISTEMAS/Principal/bin/
LOG: PrivatePath inicial = NULL
Ensamblado de llamada : Principal, Version=1.0.1.27092, Culture=neutral, PublicKeyToken=c078d737fbb55d54.
===
LOG: Este enlace empieza en el contexto de carga default.
LOG: Utilización del archivo de configuración de la aplicación: E:\Yerald Mora\Documents\SISTEMAS\Principal\bin\Principal.vshost.exe.config
LOG: Utilizando el archivo de configuración del equipo en C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Redirección detectada en el archivo de configuración de aplicaciones: 1.0.1.17265 se redirigió a 1.0.1.17261.
LOG: Referencia posterior a la directiva: Componentes, Version=1.0.1.17261, Culture=neutral, PublicKeyToken=bb48dc83eb7cd949
LOG: Ya se detectó el mismo enlace, que generó un error hr = 0x80131040.
【问题讨论】:
标签: .net visual-studio .net-assembly app-config