ASP.NET安全异常异常、安全、ASP、NET

2023-09-07 01:02:58 作者:丑人多作怪

我把从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" />