“/”应用程序中的服务器错误。

对路径“d:\wwwroot\lielong2012\wwwroot\_out.txt”的访问被拒绝。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.UnauthorizedAccessException: 对路径“d:\wwwroot\lielong2012\wwwroot\_out.txt”的访问被拒绝。

ASP.NET 无权访问所请求的资源。请考虑对 ASP.NET 请求标识授予访问此资源的权限。ASP.NET 有一个在应用程序没有模拟时使用的基进程标识(通常,在 IIS 5 上为 {MACHINE}\ASPNET,在 IIS 6 和 IIS 7 上为网络服务,在 IIS 7.5 上为配置的应用程序池标识)。如果应用程序正在通过 <identity impersonate="true"/> 模拟,则标识将为匿名用户(通常为 IUSR_MACHINENAME)或经过身份验证的请求用户。

要将 ASP.NET 访问权限授予某个文件,请在文件资源管理器中右击该文件,选择“属性”,然后选择“安全”选项卡。单击“添加”添加适当的用户或组。突出显示 ASP.NET 帐户,选中所需访问权限对应的框。

源错误:

只有在调试模式下进行编译时,生成此未经处理的异常的源代码才会显示出来。若要启用此功能,请执行以下步骤之一,然后请求 URL:

1. 在产生错误的文件的顶部添加一条“Debug=true”指令。例如:

  <%@ Page Language="C#" Debug="true" %>

或:

2. 将以下的节添加到应用程序的配置文件中:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

请注意,第二个步骤将使给定应用程序中的所有文件在调试模式下进行编译;第一个步骤仅使该特定文件在调试模式下进行编译。

重要事项: 以调试模式运行应用程序一定会产生内存/性能系统开销。在部署到生产方案之前,应确保应用程序调试已禁用。

堆栈跟踪:


[UnauthorizedAccessException: 对路径“d:\wwwroot\lielong2012\wwwroot\_out.txt”的访问被拒绝。]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +13055705
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +776
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +66
   System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) +73
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) +73
   System.IO.StreamWriter..ctor(String path, Boolean append) +37
   XMLSClass.XMLSMethodWriteOut.Execute(XMLSShell shell, XMLSNode node) +3505
   XMLS.XMLSScript.Process(XMLSShell shell, XMLSNode node) +125
   XMLS.XMLSScript.Run(XMLSShell shell, XMLSNode node) +234
   XMLS.XMLSShell.Run(String method) +231
   XMLS.XMLSHtml.Run(XMLSShell shell, XMLSNode node) +1766
   XMLS.XMLSShell.Run(String method) +178
   XMLS.XMLSHtml.Run(XMLSShell shell, XMLSNode node) +1951
   XMLS.XMLSShell.Run() +483
   Handler.ProcessRequest(HttpContext context) +96
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +188
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +71


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.4087.0