我的asp.net Web程序有时报错,但是刷新一下就好了。错误信息如下:
我可以肯定不是代码的问题.另外这个程序引用了。AjaxControlToolkit.dll这个强名称程序集,我没有注册到GAC里面去,直接放到bin目录下添加引用的
请问有谁遇到过.
Server Error in '/morent' Application.
--------------------------------------------------------------------------------Security Exception 
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492186
   System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
   System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
   System.Web.CachedPathData.GetConfigPathData(String configPath) +382
   System.Web.CachedPathData.GetConfigPathData(String configPath) +243
   System.Web.CachedPathData.GetConfigPathData(String configPath) +243
   System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +132
   System.Web.HttpContext.GetFilePathData() +27
   System.Web.HttpContext.GetConfigurationPathData() +26
   System.Web.Configuration.HttpCapabilitiesBase.GetBrowserCapabilities(HttpRequest request) +133
   System.Web.HttpRequest.get_Browser() +197
   System.Web.ErrorFormatter.RequiresAdaptiveErrorReporting(HttpContext context) +104 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 

解决方案 »

  1.   

    添加Iusr_机器名权限试验看。
      

  2.   

    看看这个
    http://www.cnblogs.com/newr2006/archive/2007/07/18/822527.html
    ------------------------------------------------------------------------
    1.请把你的文件夹权限设一下吧,添加ASP.NET这个账号.
    2.请把web.config文件中的: <trust level="Medium" originUrl=".*" />改为
      <trust level="Full" originUrl="" />或者把他注解掉.具体参考:
    http://www.microsoft.com/china/technet/security/guidance/secmod116.mspx
      

  3.   

    是Asp.net用户的问题.
    因为服务器用的是03 Server.
    与Windows 2000不同,asp.net的IIS的ISAPI程序不是asp_isapi.dll
    而是w3wp.exe程序,此进程使用的帐户不是系统用户里面的ASPNET,
    而是Network Service,把Network Service添加上就OK了。