IIS6, The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access error

I had this error when trying to run some asp.net under IIS6.

Server Error in '/' Application.
--------------------------------------------------------------------------------

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to ‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\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.

Exception Details: System.Web.HttpException: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to ‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files’.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +3570267
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +218

[HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3465427
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +69
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +279

——————————————————————————–
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

To solve it you can run aspnet_regiis. First make sure the .net framework is in your host path variable (something like C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727). Then run

aspnet_regiis -ga “NT AUTHORITY\NETWORK SERVICE”

from cmd prompt. More information on aspnet_regiis here.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • Twitter
Posted Monday, January 19th, 2009 under Computers, Development.

3 comments

  1. Hi,
    check if the ff folder exists,if not create it.
    ‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files’.
    if it already exists, check the folder permissions.
    Goodluck.
    Cheers.

  2. Thank you for the tip, will try that next time ;)

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes