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

<blockquote>
  <p>UnauthorizedAccessException
  "Access to the path 'C:\Users\Brady\Exports' is denied."</p>
</blockquote>

<p>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?</p>

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.