We had a backup domain controller running on our dev machine. After moving it to a different server, we got the following error on our development DNN websites:
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) +3482363 System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +226
[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) +3434991 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252
|
I checked all the security permissions and ensured network service had full permission for the folder. I even reset permissions to make sure. No dice. I found the following trick to fix it quickly...despite my time looking for it.
In a command prompt, navigate to the following:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Then run the following command:
aspnet_regiis -ga "NT AUTHORITY\NETWORK SERVICE"
Everything worked fine after running that. Since I am bound to forget this, I am posting it here for me and others, hopefully saving me or someone time.