Sdk 绑定重定向失败。什么;“从源头出发”;相位在融合日志中代表什么?

Sdk 绑定重定向失败。什么;“从源头出发”;相位在融合日志中代表什么?,sdk,visual-studio-2019,assembly-binding-redirect,Sdk,Visual Studio 2019,Assembly Binding Redirect,我面临一个无法理解的程序集绑定重定向失败的问题 我用以下方式为测试项目定义了绑定重定向: <?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAs

我面临一个无法理解的程序集绑定重定向失败的问题

我用以下方式为测试项目定义了绑定重定向:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.4.1.0" newVersion="4.4.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
我已启用Fusion日志以查看runner未能加载程序集的原因:

*** Assembly Binder Log Entry  (02-Oct-20 @ 16:39:34) ***

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

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\TestPlatform\testhost.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
 (Fully-specified)
LOG: Appbase = file:///C:/Users/_.__/src/_/Artifacts/IntegrationTests/x64/Debug/net472/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Tests_373511859
Calling assembly : Castle.Windsor, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\_.__\src\_\Artifacts\IntegrationTests\x64\Debug\net472\_IntegrationTest.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.0.0.0 redirected to 4.4.1.0.
LOG: Post-policy reference: Castle.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/_.__/src/_/Artifacts/IntegrationTests/x64/Debug/net472/Castle.Core.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\_.__\src\_\Artifacts\IntegrationTests\x64\Debug\net472\Castle.Core.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
我仔细检查了它,文件“.\Artifacts\IntegrationTests\x64\Debug\net472\Castle.Core.dll”的版本与预期的一样为4.4.1.0,但由于未知原因,日志显示为4.0.0.0

我注意到探测在“从源代码运行”阶段失败。这是否意味着程序集是从日志中提到的不同位置加载的

据我所知,这种行为看起来像是绑定机制中的错误

我期待着一些提示,帮助我找出问题的根本原因。

我也有类似的建议:如果我们解决了这个问题,可能值得交换意见
*** Assembly Binder Log Entry  (02-Oct-20 @ 16:39:34) ***

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

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\TestPlatform\testhost.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
 (Fully-specified)
LOG: Appbase = file:///C:/Users/_.__/src/_/Artifacts/IntegrationTests/x64/Debug/net472/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Tests_373511859
Calling assembly : Castle.Windsor, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\_.__\src\_\Artifacts\IntegrationTests\x64\Debug\net472\_IntegrationTest.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.0.0.0 redirected to 4.4.1.0.
LOG: Post-policy reference: Castle.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/_.__/src/_/Artifacts/IntegrationTests/x64/Debug/net472/Castle.Core.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\_.__\src\_\Artifacts\IntegrationTests\x64\Debug\net472\Castle.Core.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.