Load System.Web 失败,但 load System.Xml 成功



从融合日志中,问题是System.Web 2.0被重定向到System.Web 4.0,它不在GAC中,因此无法加载。我将其与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:WindowsSysWOW64pnbrksvc.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFrameworkv4.0.30319configmachine.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:WindowsSysWOW64pnbrksvc.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFrameworkv4.0.30319configmachine.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:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xmlv4.0_4.0.0.0__b77a5c561934e089System.Xml.dll.
LOG: Assembly is loaded in default load context.

我假设.NET 4附带System.Web。是否可以像以某种方式将System.Web v4.0重新安装到GAC中一样简单?

首先,在machine.config中拥有这个是非常糟糕的。可能会导致在以前的 .net 版本上运行的应用程序出现大量问题。

关于丢失的system.web.dll也许在该服务器上,有人只安装了.NET 4客户端配置文件。客户端配置文件不包括系统.web...

最新更新