UnauthorizedAccessException与IIS7 [英] UnauthorizedAccessException with IIS7

查看:107
本文介绍了UnauthorizedAccessException与IIS7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写从IIS7下的ASP.NET应用程序的日志文件,但不断收到以下异常:

I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception:

UnauthorizedAccessException
  访问路径C:\\用户\\布雷迪\\出口'被拒绝。

UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied."

我已经给到IIS_IUSRS,IIS_WPG以及ASPNET用户具有写权限的基础上,由谷歌发现的各种意见,但仍然得到错误。有人可以解释我如何可以创建在该目录中的日志文件,或者将创建Web应用程序本身自动允许写入文件下一个日志目录,这是也许不是一个更好的解决方案?

I have given write access to the iis_iusrs, iis_wpg, and aspnet users, based on various advices found by Google, but still get the error. Can someone please explain how I can create a log file in that directory, or, will creating a log directory under the web application itself automatically allow writing the file, and is this not perhaps a better solution?

推荐答案

您需要将权限授予下列帐户之一

You need to grant permission to one of the following accounts

ASPNET - Win XP and Win 2000
NETWORK SERVICE - Win Vista and 2003

这是默认值,如果应用程序池已配置了一个不同的进程帐户,那么你就需要与特定帐户的工作。

These are the defaults, if the application pool has been configured for a different process account then you would need to work with that specific account.

这篇关于UnauthorizedAccessException与IIS7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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