访问路径“C:\\的Inetpub \\ wwwroot的\\ MyApp的\\ App_Data文件”被拒绝 [英] Access to the path 'c:\inetpub\wwwroot\myapp\App_Data' is denied

查看:1241
本文介绍了访问路径“C:\\的Inetpub \\ wwwroot的\\ MyApp的\\ App_Data文件”被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装在WinXP IIS,

当我试图执行一个应用程序,我得到一个错误


  

访问路径C:\\的Inetpub \\ wwwroot的\\ MyApp的\\ App_Data文件'被拒绝。
  说明:在执行过程中发生未处理的异常
  当前Web请求。有关详情,请堆栈跟踪
  有关错误的信息它起源于code。


  
  

异常详细信息:System.UnauthorizedAccessException:访问
  路径C:\\的Inetpub \\ wwwroot的\\ MyApp的\\ App_Data文件'。被拒绝


  
  

ASP.NET未被授权访问所请求的资源。考虑
  授予访问权限的资源添加到ASP.NET请求
  身份。 ASP.NET有一个基进程标识(通常
  {MACHINE} \\ ASPNET,在IIS 5或IIS 6网络服务)用于当
  该应用程序没有模拟。如果该应用程序是
  通过模仿,身份会
  匿名用户(通常为IUSR_MACHINENAME)或经过身份验证
  请求用户。


  
  

要ASP.NET访问权限授予一个文件,右键单击该文件在资源管理器,
  选择属性,然后选择安全选项卡。点击添加来添加
  适当的用户或组。突出显示ASP.NET帐户,
  检查框所需的访问。


  
  

源错误:


  
  

70行:保护小组cmbSettingFiles_SelectedIndexChanged(BYVAL
  发送者为对象,BYVAL E上System.EventArgs)把手
  cmbSettingFiles.SelectedIndexChanged结果
  71号线:昏暗的DOC作为XmlDocument的=新的XmlDocument()结果
  72号线:doc.Load(Path.Combine(基本路径,cmbSettingFiles.SelectedValue))
  74行:Dim settingsNode作为XmlNode的= doc.SelectSingleNode(/设置)


  
  

源文件:C:\\ MyApp的\\安装\\ install.aspx.vb行:72


我已经做这个尝试光栅权限


  

要ASP.NET访问权限授予一个文件,右键单击该文件在资源管理器,
  选择属性,然后选择安全选项卡。点击添加来添加
  适当的用户或组。突出显示ASP.NET帐户,
  检查框所需的访问。


但错误依然存在。

这是否有什么与我的code?

我怎样才能解决这个问题?

修改

我已经解决了我的开发机器上的probleom,但仍然得到Web服务器上的误差

感谢


解决方案

  

试着去App_Data文件夹属性,并添加ASPNET用户具有读
  和写入权限


参考:结果
<一href=\"http://www.afterlogic.com/kb/articles/how-to-assign-correct-permissions-to-appdata-folder-of-webmail-pro-aspnet\">How以正确的权限分配给邮局临ASP.NET的App_Data文件夹结果
在App_Data文件夹结果权限
<一href=\"http://serverfault.com/questions/14655/asp-asp-net-best-way-to-handle-write-permissions\">ASP/ASP.NET处理写权限的最佳方式?

如果它不能解决那么你的问题检查你的XML文件是否没有被另一个线程打开使用这些配置文件..并提供一些更多的细节,如果仍然存在。

i just installed iis on winxp,

when i tried to execute an app, i get an error

Access to the path 'c:\inetpub\wwwroot\myapp\App_Data' is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 'c:\inetpub\wwwroot\myapp\App_Data' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

Line 70: Protected Sub cmbSettingFiles_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbSettingFiles.SelectedIndexChanged
Line 71: Dim doc As XmlDocument = New XmlDocument()
Line 72: doc.Load(Path.Combine(basePath, cmbSettingFiles.SelectedValue)) Line 74: Dim settingsNode As XmlNode = doc.SelectSingleNode("/settings")

Source File: C:\myapp\install\install.aspx.vb Line: 72

I have tried grating permission by doing this

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

but the error persist.

Does this have anything to do with my code?

How can i resolve this?

EDIT

I have solved the probleom on my dev machine, but still getting the error on web server

thanks

解决方案

Try to go to App_Data folder property and add ASPNET user with read and write privileges

Ref:
How to assign correct permissions to App_Data folder of WebMail Pro ASP.NET
Permissions on APP_DATA Folder
ASP/ASP.NET Best way to handle write permissions?

If it does not solve your problem then check whether your XML files are not open by another thread using these configuration files.. and provide some more details if still persists.

这篇关于访问路径“C:\\的Inetpub \\ wwwroot的\\ MyApp的\\ App_Data文件”被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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