gpt4 book ai didi

c# - 加载 System.Web 失败但加载 System.Xml 成功

转载 作者:太空宇宙 更新时间:2023-11-03 10:52:33 26 4
gpt4 key购买 nike

从融合日志来看,问题是 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 绑定(bind)的片段:

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 绑定(bind)的片段:

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 中一样简单?

最佳答案

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

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

关于c# - 加载 System.Web 失败但加载 System.Xml 成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20906433/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com