C# 绑定重定向在测试项目中不起作用

C# 绑定重定向在测试项目中不起作用,c#,binding,assemblies,C#,Binding,Assemblies,在测试项目的app.config中应用绑定重定向时。运行时拒绝遵守重定向命令,并继续搜索程序集的旧版本 <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Msdcc.Common" publicKeyToken="9d9c15280f7f1425"/>

在测试项目的app.config中应用绑定重定向时。运行时拒绝遵守重定向命令,并继续搜索程序集的旧版本

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Msdcc.Common" publicKeyToken="9d9c15280f7f1425"/>
      <bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>
我的虽然过程

这让我想到,如果我的配置文件中存在链接,为什么它仍然不执行程序集重定向

我是一个新手,我刚刚决定完全按照老人告诉我的去做,并从配置元素中删除了名称空间声明,嘿,普雷斯托,它成功了。xmlns=”http://schemas.microsoft.com/.NetConfiguration/v2.0"


在这篇长篇大论之后,我的问题是,据我所知,名称空间声明只会干扰Intellisense,为什么它会与程序集绑定发生冲突?

通过设计将程序集加载到反射加载上下文中会忽略发布者策略和绑定重定向策略


这里也提出了类似的问题:

很抱歉Lukas的回复非常晚,是使用vs2008 SP1。您是否找到了解决此问题的方法?
*** Assembly Binder Log Entry  (28/07/2010 @ 18:59:36) ***

The operation failed.
Bind result: hr = 0x80131040. No description available.

Assembly manager loaded from:  C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = BELGACOM\id820374
LOG: DisplayName = Msdcc.Common, Version=2.2.0.0, Culture=neutral, PublicKeyToken=9d9c15280f7f1425
 (Fully-specified)
LOG: Appbase = file:///c:/data/source/explorev1/explore.root/explore/euc.explore.domainobjectstest/bin/debug
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: This is an inspection only bind.
LOG: Using application configuration file: c:\data\source\explorev1\explore.root\explore\euc.explore.domainobjectstest\bin\debug\euc.explore.domainobjectstest.dll.config
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///c:/data/source/explorev1/explore.root/explore/euc.explore.domainobjectstest/bin/debug/Msdcc.Common.DLL.
LOG: Assembly download was successful. Attempting setup of file: c:\data\source\explorev1\explore.root\explore\euc.explore.domainobjectstest\bin\debug\Msdcc.Common.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Msdcc.Common, Version=2.4.0.0, Culture=neutral, PublicKeyToken=9d9c15280f7f1425
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.