We help IT Professionals succeed at work.

Intermittent .NET Error

infotechelg
infotechelg asked
on
74 Views
Last Modified: 2016-02-02
Yesterday, I had a user report to me the following error on our live site:

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files'.
However, I was not able to reproduce the error. So I just wrote it off as a fluke.

Today, a co-worker sitting next to me was browsing one of our live sites and came upon the error. All I had to do was reload the page and the error went away. It hasn't happened since, but I'm worried it'll happen again.

Any ideas why this would just randomly happen, and any ideas on how to fix it?

Please let me know if you require any other information.

Thanks in advance!
Comment
Watch Question

Emmanuel AdebayoGlobal Windows Infrastructure Engineer - Consultant
CERTIFIED EXPERT
Top Expert 2013

Commented:
Hi,

Was there any error log in the event viewer when this incident occured?

Ensure that "Network Services" or whichever account you are using to run the application pool has write permission to :\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET.

This can occur when proprietary Windows security policies prohibit proper access from being set for this directory during installation.

I hope this helps
CERTIFIED EXPERT

Commented:
Try this:
Open command prompt as administrator and run the below command.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet_regiis.exe -ga server\user

Open in new window


This gives that user access to the iis configuration and other directories used by ASP.NET
CERTIFIED EXPERT

Commented:
server\user is the user you are using i.e. in your case server_name\Network Services
CERTIFIED EXPERT

Commented:
And if you are on a 32 bit system them

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Aspnet_regiis.exe -ga server\user

                                          

Open in new window

Author

Commented:
Thanks. Before I run this, will this cause IIS to break or anything? Should I run it after-hours? Or, is it pretty harmless?

Author

Commented:
Also, I'd like to understand why this, seemingly out of the blue, just started happening. This server and these sites have been running for years and this has never happened before.

Any insight would be greatly appreciated.
CERTIFIED EXPERT

Commented:
It wont break IIS or anything. It will just give the rights to Network Service. If your site has live users then you can do it after hours or if you can bear with a downtime of 10-30 seconds, do it now.
CERTIFIED EXPERT

Commented:
There seems to be a bug in ASP.NET 3.5 which sometimes did not allow the user rights to the folder. Though Microsoft is silent on if the bug is also in v4.0 and v4.5, users have faced this issue and used this to solve the issue.

Primarily the reason it seems is that the folder being used by another app pool at the moment or by any other user. Over all a mysterious bug just like another one that comes with aspnet membership. It fails rarely with a general failure.
CERTIFIED EXPERT

Commented:
This solution has worked for most. A more basic solution is running

aspnet_regiis -i

Open in new window


from command prompt as Administrator. Just replace -ga server\user with the flag -i.

Author

Commented:
Thanks! I'll give it shot after-hours and let you know if there are any more reports tomorrow of the issue happening.

Author

Commented:
Just to be sure, for "server\user" do I use "NT AUTHORITY\NETWORK SERVICE" that was in the error, or am I using the actual server name for "server"? "SERVERNAME\NETWORK SERVICE"?
CERTIFIED EXPERT

Commented:
Actual Server Name\Network Service.
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, everyone for your input. It turned out to be that one of the server's C:\ drive was too low on space. Hopefully this will help someone else in the future.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.