Active Server Pages Programming (ASP)/Server Error in '/' Application.

Advertisement


Question
Hi,

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

Answer
Well, 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.

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Chris

Expertise

I can answer pretty much any question relating to VB.NET and its use in a Windows environment. I can also handle most questions using C#. I specialize in ASP.NET web development and MSSQL database access, but have some stale knowledge of the old ASP - I'd prefer to avoid questions about it.

Experience

I have over 5 years of industry experience using VB.NET and other .NET technologies for web and database development.

Education/Credentials
I have some college education, but does it really matter in this field of work?

©2012 About.com, a part of The New York Times Company. All rights reserved.