Joshua Johnson

ASP.NET, ASP.NET AJAX, Silverlight, VS 2008

Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0×80070057 (E_INVALIDARG))

If you are working with the Ajax Control Toolkit, sometimes the AjaxControlToolkit assembly will become corrupted in your Temporary ASP.NET Files folder. Here are a set of steps that might help you get back up and running. This is only relevant to developing with the built in web server, Cassini.

But first, here is the scenario.

Last Friday, my computer crashed while I was working on a project which references the AJAX Control Toolkit assembly.

After my computer restarted, I opened the project in Visual Studio 2008. I launched the default web page and I received the following error:

Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0×80070057 (E_INVALIDARG))

I tried closing and reopening the project; I even restarted my computer, but none of these efforts were successful.

I deleted and re-added the AjaxControlToolkit assembly reference, but still no dice.

Here are the steps that I found which worked for me:

  1. Close Visual Studio
  2. Open the Temporary ASP.NET Files folder and delete its contents.
    • If the OS is Windows Vista, then the folder is %LocalAppData%\Temp\Temporary ASP.NET Files
    • If the OS is Windows XP, then the folder is %WINDIR%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
  3. Restart Visual Studio
  4. Open the project

That's it. Works great now.

Hope this helps.

Joshua

Comments

John Walker said:

One quick hint. If you're developing against IIS directly instead of the built-in VS.NET web server (Casini), you'll need to delete the temp files from %WINDIR%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files.

# December 23, 2008 2:00 AM

jparker said:

Very nice.  Thanks for sharing.  I have encountered this error many times, and had previously been unable to find a solution other than running a repair on the .NET framework 3.5.

# July 23, 2009 11:52 AM

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

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

# September 1, 2009 7:28 PM

Dale Edwards said:

This didn't work for me. Did everything Joshua suggested.

# September 21, 2009 12:23 PM

Daniel said:

Thanks!!!! Works perfectly =D

# October 5, 2009 1:39 PM

Palsur said:

Thanks! Works perfectly

Gracias aunque esta en inglés se entiende y lo más importante es que funciona.-

# October 29, 2009 10:43 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)