从融合日志中,问题是 System.Web 2.0 被重定向到不在 GAC 中的 System.Web 4.0,因此无法加载。我将它与 System.Xml 2.0 进行了比较,后者也被重定向到 System.Xml 4.0,但它确实在 GAC 中,因此加载成功。
我们的 app.config 强制从 2.0 程序集重定向到 4.0 程序集。
这是失败的System.Web 绑定的片段:
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Windows\SysWOW64\pnbrksvc.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0.
LOG: Post-policy reference: System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
这是成功的System.Xml 绑定的片段:
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Windows\SysWOW64\pnbrksvc.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0.
LOG: Post-policy reference: System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: Binding succeeds. Returns assembly from C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll.
LOG: Assembly is loaded in default load context.
我会假设 .NET 4 附带 System.Web。是否可以像以某种方式将 System.Web v4.0 重新安装到 GAC 中一样简单?