ASP.NET安全异常 [英] ASP.NET Security Exception

查看:135
本文介绍了ASP.NET安全异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把从XP ASP.NET应用程序到一个新的服务器,现在我有这样的例外:

I moved an ASP.NET application from a XP to a new server and now I have this exception:

System.Security.Permissions.SecurityPermission,   mscorlib程序,版本= 2.0.0.0,   文化=中性,

'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral,

在这一行code:

System.Threading.Thread.CurrentThread.CurrentCulture   =新System.Globalization.CultureInfo(IT-IT);

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("it-IT");

我的服务器,以便可配置: Windows XP的2003服务器版 的SharePoint 微软的Visual Studio 2008团队系统工作组服务器

My server is so configurated: Windows XP 2003 Sever SharePoint MS Visual Studio 2008 Team System Workgroup Server

我试图改变安全设置,machine.config中。 有人可以帮我解释一下我在哪里以及如何改变呢?

I tried to change security setting, machine.config. Someone can help me explain me where and how to change what?

多谢了。

推荐答案

的SharePoint不考虑在.NET Framework中的所有程序集是安全的,你只需要几行添加到您的web.config文件中的应用程序。

SharePoint doesn't consider all assemblies in the .NET Framework as safe you just need to add a couple of lines to your web.config file in your application.

做到这一点在SharePoint SafeControls部分:

Do it in the Sharepoint SafeControls section:

<SafeControl Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Security" TypeName="*" Safe="True" AllowRemoteDesigner="True" />
<SafeControl Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Security.Permissions" TypeName="*" Safe="True" AllowRemoteDesigner="True" />

这篇关于ASP.NET安全异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆