Active Server Pages Programming (ASP)/Server Error in '/' Application.
Expert: Chris - 10/7/2007
QuestionHi,
Im new to asp programming and writting my first Hello World program.
Im using:
Microsoft Development Environment 2003 Version 7.1.3088
Microsoft .NET Framework 1.1 Version 1.1.4322 SP1
I get a error as below when browse
http://localhost/HelloWorld.aspx
Server Error in '/' Application.
--------------------------------------------------------------------------------
The current identity (CYK016-03\ASPNET) 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 (CYK016-03\ASPNET) 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 (CYK016-03\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +3591451
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +222
[HttpException (0x80004005): The current identity (CYK016-03\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3540923
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +69
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +275
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
I had no idea what is going on and I had tried to fix it but fail.
Can you please help me?
Thanks & Regards,
alan
AnswerWell, the error message actually says exactly what is going on:
The current identity (CYK016-03\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.
ASP.Net applications run under a worker process, and this in turn must be run under a user account. For security reasons, Microsoft won't let this run as the SYSTEM account, because it has full control of your system. Instead, it runs as a user called ASPNET. CYK016-03 is apparantly your computer name. And what the error is saying is that this ASPNET user on your computer does not have access to write to the folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\. This is where ASP.Net generates its temporary files (mostly assembly DLL files), and the worker process user account must have write access to this folder for ASP.Net to launch.
So, log onto your computer as Administrator and open Windows Explorer. Browse to C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\. Right-click the "Temporary ASP.NET Files" folder and pick Properties. Go to the Security tab, and click Add. Type in CYK016-03\ASPNET and click OK. Then find the ASPNET user in the list, and Grant it Full Control. Click OK. Then, go to Control Panel -> Administrative Tools -> Services, find IIS Admin Service in the list, right-click it and pick Restart.
Should work.