Monday, February 25, 2008

Grant a user or group to the IIS metabase and other directories ...

After you create a new website or virtual directory and browse a aspx file,
you might have error such as...

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to C:\WINDOWS\Microsoft.NET\
Framework\v2.0.50215\Temporary ASP.NET Files'.

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.

[Answer]
You can grant access to this account explicitly using the aspnet_regiis -ga switch,
for example:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215>aspnet_regiis -ga "NT Authority\Network Service"

[Ref]
aspnet_regiis -ga
Grant the specified user or group access to the IIS metabase and other directories used by ASP.NET.

No comments: