Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. Access is denied.

Reddy Kadasani

Problem: Recently i came across this problem while switching to a new Windows 7 64 bit m/c. The web site at hand was working fine on my previous m/c Windows 7 64 bit RC1. The error and the event log were basically not very helpful either.

Resolution:

So here is what I did to fix the issue (to get it to work using IIS):

1. Make sure that the dll in question is either set to “Copy to: Local). Go to References, right click on AjaxControlToolkit and select properties. In my case it was already set to Copy Local. So that was not the issue

2. Open IIS Manager, browse to the AppPool (in my case it was the DefaultAppPool… it is just a Dev box, ok!). Go to Advanced Settings, and set Enable 32-bit Applications to true. Now that did fix the problem I was having.

For Cassini:

1. I had to give modify rights on the asp.net temp folder  to the Apppool identity (in my case IIS users group).

Discussion

  • On further research (i.e. “google”), I came to the conclusion that it was a permissions error related to the Temporary ASP.NET Files folder (C:\Windows\Microsoft.NET\Framework64\v2.0.50727). Some of the other fixes for this problem can be found on other blogs. They relate to the access permissions on the ASP.NET folder, Trust level Settings on the Website, and Anti-virus settings. Here is a link to some of them:
  • What I found was that the main focus while resolving this error should be on the later part of the error that says ‘Access is denied’ or “Invalid Argument’ etc.. that will help you in attacking the issue. In my case it was the fact that I was running a 32 bit app on a 64 bit mc and a permissions issue as well on the Temporary ASP.NET folder.
  • If you get an ‘Access Denied’..try checking the permissions on the Temp ASP.NET folder.
  • If you get ‘Invalid Argument’ try cleaning the temp asp.net folder and restarting the web site.

http://lichao.net/eblog/fix-access-is-denied-exception-from-hresult-0x80070005-e_accessdenied-on-local-machines-200905307.html

http://weblogs.asp.net/joshuajohnson/archive/2008/12/22/could-not-load-file-or-assembly-ajaxcontroltoolkit-or-one-of-its-dependencies-the-parameter-is-incorrect-exception-from-hresult-0-215-80070057-e-invalidarg.aspx

http://msforums.ph/forums/t/46678.aspx

6 Comments. Leave new

Kadasani,

Microsoft does have an official Windows 7 RC Support Forum located here http://tinyurl.com/9fhdl5 . It is supported by product specialists as well as engineers and support teams. You may want to check the threads available there for additional assistance and feedback.

Jessica
Microsoft Windows Client Team

“Enable-ing 32-bit Applications to true” did it for me. Thanks!

Mehboob Ali Yousafza
March 9, 2011 2:20 pm

Thanks alot.it was antivirus issue and also i gave permissions on the Temp ASP.Net Folder

You can try this: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ . Just clean up all the folders and files from inside this folder and compile ur application. Happy coding!

after browsinfg to the AppPool in Iss Manager i have not found the Advanced Settings, but i foundand the Advanced Setting when i select a but there i did not find any option like “Enable 32-bit Applications”.
i have done the other options like
1.Go to References, right click on AjaxControlToolkit and select properties to Copy Local
2. clean up all the folders and files from Temporary ASP.NET Filesfolder
but still no result. please help..

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>