从.net 3.5升级我的web应用程序.Net4.0之后,我得到一个安全透明的规则失败。
我从来没有听说过这或将其纳入我的项目。 有没有人有任何想法,这可能是?
解决方案从微软的知识库 KB2635463 :
原因 发生此问题,因为当System.Web.UI.ScriptManager类 第一次实例它建立的方法信息缓存 类组件已经加载的应用程序。当它试图 检查InstrumentedAttribute异常的构造 被抛出,不处理。
分辨率 为了可靠地解决此问题,实例化的一个实例 的ScriptManager在应用过程中的一个点之前启动向 第一次请求实际上是被执行,但具有组装后 所述InstrumentedAttribute已加载
例如,在Global.asax中增加一些新的code到的Application_Start:
私人无效的Application_Start(HttpApplication的应用程序)
{
如果(applicationStartupComplete)回报;
尝试
{
对象OSM =新System.Web.UI.ScriptManager();
}
赶上(例外)
{}
}
此外,帖子在asp.net论坛上透露的从微软的员工这个答案:
我们已经看到了问题的结合,可能会导致这样的:
1)的 Web服务器有信任级别设置为低于全在机器 web.config文件(裁判)
2)的网络服务器不具有的AJAX文件(System.Web.Extensions程序) 安装到GAC。
解决方案1::设置信任级别为完全的机级别的web.config
解决方案2:安装AJAX文件到海关总署
如果清凉解决它 - 它可能只是一个时间问题加载 扩展。也许,如果你安装到GAC将解决 吧。
After upgrading my web app from .Net 3.5 to .Net4.0, I get a security transparency rules failed.
I've never even heard of this or incorporated it into my project. Does anyone have any idea what this may be?
解决方案From Microsoft's knowledge-base 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)
{}
}
Additionally, a post at the asp.net forums reveals this answer from a Microsoft employee:
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.
Solution 1: Set trust level to "Full" in the machine level web.config
Solution 2: Install AJAX files into the GAC
If refreshing resolves it - it might just be a timing issue loading the extensions. Probably if you install into the GAC it will resolve it.
上一篇:在Android应用程序安装过程中创建的文件夹过程中、应用程序、文件夹、Android
下一篇:Tensorflow 模型正确拟合格式数据——TypeError:无法将符号 Keras 输入/输出转换为 numpy 数组数组、转换为、符号、模型