用于绑定重定向的框架配置在哪里?

Sve*_*ven 4 .net dll assembly-binding-redirect .net-standard

我的ASP.NET MVC网络后端消耗System.Security.Cryptography.Algorithms.dll. 在构建时,该 dll 位于:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\Facades

在运行时,dll 被解析为:

C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll

fuslogvw显示的是:

...
LOG: Assembly download was successful. Attempting setup of file: path\to\bin\System.Security.Cryptography.Algorithms.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.Security.Cryptography.Algorithms, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: path\to\web.config
LOG: Using host configuration file: C:\Users\xxx\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Version redirect found in framework config: 4.2.2.0 redirected to 4.0.0.0.
LOG: Post-policy reference: System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Binding succeeds. Returns assembly from C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Security.Cryptography.Algorithms\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.Cryptography.Algorithms.dll.
LOG: Assembly is loaded in default load context.
Run Code Online (Sandbox Code Playgroud)

我对线特别感兴趣 LOG: Version redirect found in framework config: 4.2.2.0 redirected to 4.0.0.0.

问题:

上面提到的框架配置在哪里?日志中提到的三个文件 ( web.configmachine.configaspnet.config) 都不包含 的绑定重定向指令System.Security.Cryptography.Algorithms.dll,那么它在哪里呢?

Ale*_*SFT 6

您看到的行来自运行时内的统一表。

运行时对少数程序集有特殊的了解,如果没有指定用户指定的绑定重定向(在您提到的位置),则对这些程序集应用特殊的绑定重定向。