8

I get the following error when running my Visual Studio 2008 ASP.NET project (start without Debugging) on my XP Professional box:

System.Web.HttpException: The current identity (machinename\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.

How can I resolve this?

Colin Pear
  • 3,028
  • 1
  • 29
  • 33
y0mbo
  • 4,582
  • 6
  • 41
  • 45

8 Answers8

15

Have you tried, the aspnet_regiis exe in the framework folder?

DevelopingChris
  • 39,797
  • 30
  • 87
  • 118
  • Rookie mistake... forgot about that and did a Windows repair the other day without rerunning. – y0mbo Sep 17 '08 at 18:31
  • I tried doing this, but it was only temporary. Is there a permanent solution to this? – Bob. Jun 28 '11 at 18:04
  • Why would running aspnet_regiis help? This seems like a security issue. – Attila Kun Sep 09 '11 at 07:01
  • I still have the problem, is it because, my hard disk is completely encrypted? – Hari Gillala Jun 11 '12 at 11:03
  • @HariGillala over the last few years since this answer things have gotten more complicated with app pool identity and disk permissions. Try making sure you are using a real user, or that the app pool identity has appropriate permissions as well. – DevelopingChris Jun 14 '12 at 20:46
  • Hi DevelopingChris- Do you have any links to good articles to understand how this works and what steps to troubleshoot / resolve? – Christopher Painter Jun 23 '14 at 16:00
  • @ChristopherPainter In essence this script is an old program that manipulates iis in the way the modern powershell does to add the isapi modules and ensure the folders are setup for asp.net to be part of iis. 4guys from rolla used to have stuff on it. But that is why it's dangerous as it's oblivious to outside effects on the file system or other versions of .net needing to be registered as well. – DevelopingChris Jun 25 '14 at 17:15
12

I had the same problem. This is what I did:

  1. Go to c:\windows\microsoft.net\framework\v2.0.50727
  2. right click on "Temporary ASP.NET files"
  3. Security tab
  4. Select "Users(xxxxxx\Users) from Group
  5. check "Write"
  6. OK
ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
Djay
  • 121
  • 1
  • 2
3

Either grant that user the level of access to that directory, or change the identity that the application's application pool runs under - in IIS Manager, determine what App Pool is used to run your application, then in the App Pool section of IIS Manager, look at the properties for that pool - the tab you want is "Identity" I think (this is off the top of my head).

You can set it to another user account - for example, Crystal Reports .Net requires update and delete access to C:\Temp - so we have a "webmaster" user, with administrator access, and use that identity for those applications.

Ken Ray
  • 2,500
  • 3
  • 21
  • 28
0

you can right click the Visual Studio & select run as administrator.

Pragnesh Patel
  • 1,444
  • 3
  • 23
  • 38
0

I had this problem when trying to build a Web Deployment Project (*.wdploy). Simply creating the folder on the framework path solved the error.

emp
  • 4,926
  • 2
  • 38
  • 50
0

Just because the most recent answer is 5 years old, what had to be done in our environment was to delete the app, app pool and recreate them.

We evidently have some security under the hood with recent changes to it.

Doing this re-created a folder in Temporary ASP Net Files with all the correct permissions. Why the one site I happened to just get from source control, rebuild, etc. failed this way, no idea. 2 others recently set up where Get Latest Version was downloaded, rebuilt, etc. they just worked.

But ripping out the app, app pool and just recreating them with the same IIS permissions as the 2 other known working sites recreated all the needed objects and now it all works.

user1585204
  • 827
  • 1
  • 10
  • 14
0

You can try to fix it using the automated regiis utility aspnet_regiis.ext available in c:\windows\microsoft.net\framework\v2.0.50727

Otherwise just manually add the needed file permissions as noted in the error.

Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173
-1

Make sure the ASPNET user has permission to write to that folder. Right click on the folder, Properties, Security tab.

ddc0660
  • 4,022
  • 2
  • 21
  • 30