Fix Access is denied (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED)) on local machines

ASP.NETSince Wednesday, all developers’ machines could not load asp.net applications on Visual Studio’s development servers. And we even could not debug, build the solution and could not Copy Website either; and could not drag/drop the AJAX Extension toolkit controls to the web forms.

The error message when we loaded the web application was the following:

Server Error in ‘/MyAPP’ Application.


Access is denied. (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED))

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.

……

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.

……

[FileLoadException: Could not load file or assembly 'AjaxControlToolkit, Version=1.0.20229.20821, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. Access is denied.]

I thought there was a file/directory permission issue to cause the problem above. But after I put “everyone” with Full Control privilege on /bin folder and C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files, the problem still did not go away, even after my couple of reboots.

I also tried putting <identity> tag in the web.config file as suggested from the Internet, but still not working.

What else I tried? Oh, yes, I tried deleting all files, directories from the Temporary ASP.NET Files directory, and running web application from IIS instead of Visual Studio included development server.

After hours of internet researching, finally I gave up the googling and decided to do my own “mechanic” stuff on the machine.

The first place I went was the Windows Event Viewers and gladly found these error logs in Application category. (Source: McLogEvent)

Blocked by access protection rule.  Access to object C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\myapp\ee9caa0b\b8934286\assembly\dl309fee900bea983_e87ac801\AjaxControlToolkit.DLL was blocked by rule Anti-spyware Maximum Protection:Prevent all programs from running files from the Temp folder.

Haha, finally found this stupid cause. It seems that my company just updated the Anti-virus software McAfee Enterprise policy and enhanced the Access Protection feature. Appearntly there is a new Anti-SpyWare Maximium Protection implemented in the McAfee which blocked the ASP.NET process to load from ASP.NET Temporary Files folder. While this temporary folder was the place for asp.net web applicaiton loads assembly components.

Solution:

Knowing the cause, then the soluciotn is easy. Just lanuch McAfee — Viruscan Console and disable the Access Protection from there. You might need to type a password to unlock this console to do.

If you encounter the similar problem with other anti-virus softwares, please refer to their manul to unblock your ASP.NET Temporary Files folder.

Good luck.

  • Share/Bookmark
Tags: ,

Related posts

5 Responses to “Fix Access is denied (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED)) on local machines”


  • Holy Angel.. was doing all stuffs from the internet.. Thought about this but ignored as I felt this may not be the reason… Thanks…

    [Reply]

    Mike replied on May 26th, 2009:

    Wow, this would have been the last thing I looked it. As soon as I disabled the feature (different antivirus) it worked.

    Thanks for the solution.

    [Reply]

  • This was the cause of the error on my machine. Thanks!!!!! As soon as I turned my antivirus (McAfee) software off it worked like normal. There seem to be quite a few different causes out there but if nothing else is working, try this.

    [Reply]

  • Thanks guy,
    I was facing the same problem because I have just added McAfee yesterday. Because of this post, I was able to find the solution.

    [Reply]

  • Thanx a million,
    I was facing the problem after I changed my antivirus. changing the access protection worked like magic. Thanx

    [Reply]

  • Thank you so much!!

    [Reply]

Leave a Reply