gpt4 book ai didi

c# - 将我的 Web 应用程序从 .Net 3.5 升级到 .Net4.0 后,出现安全透明规则失败

转载 作者:行者123 更新时间:2023-11-30 18:02:02 24 4
gpt4 key购买 nike

将我的网络应用程序从 .Net 3.5 升级到 .Net4.0 后,我收到安全透明规则失败的消息。

enter image description here

我从来没有听说过这个,也没有将它纳入我的项目中。有谁知道这可能是什么?

最佳答案

来自 Microsoft 的知识库 KB2635463 :

Cause
This problem occurs because when the System.Web.UI.ScriptManager class is first instantiated it builds a cache of method information for classes in assemblies already loaded in the application. When it tries to examine the constructor of the InstrumentedAttribute the exception is thrown and not handled.

Resolution
To workaround this issue reliably, instantiate an instance of ScriptManager at a point during application start up prior to the first request actually being executed but after the assembly that has the InstrumentedAttribute has been loaded.

For example, in global.asax add some new code to Application_Start:

private void Application_Start(HttpApplication application) 
{
if (applicationStartupComplete) return;
try
{
object osm = new System.Web.UI.ScriptManager();
}
catch(Exception)
{}
}

另外,一个 post在 asp.net 论坛上显示 this answer来自 Microsoft 员工:

We have seen a combination of issues that might cause this:

1) The webserver has the trust level set less than "Full" at the machine web.config (ref)

2) The webserver does not have the AJAX files (System.Web.Extensions) installed into the GAC.

解决方案 1:在机器级别 web.config 中将信任级别设置为“完全”

解决方案 2:将 AJAX 文件安装到 GAC 中

如果刷新解决了它 - 它可能只是一个加载时间问题 扩展名。如果你安装到 GAC 中,它可能会解决

关于c# - 将我的 Web 应用程序从 .Net 3.5 升级到 .Net4.0 后,出现安全透明规则失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8408654/

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