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

Razwan Serwar said:

Thanks for sharing this information, I found another possible solution which may help: www.sajeelmunir.com/.../could-not-load-file-or-assembly-ajaxcontroltoolkit.aspx

# December 11, 2009 9:57 AM

Tonmoy said:

my website is no problem when it run on my pc.

but when i put it web site the it give me the following error

"Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies"

please give me a solution

# January 24, 2010 8:08 AM

Cathy said:

Your solution worked perfectly, thanks so much!

# February 2, 2010 12:59 PM

bluelegion said:

Awesome!  Thanks!

Joshua for President!

# April 15, 2010 12:53 AM

Priyanka said:

thanx ,ur suggestion works perfectly

# April 22, 2010 6:18 AM

Marc said:

Yep, it worked perfectly! Thanks Joshua :)

# November 16, 2010 2:27 PM

arleonello said:

Solved for me clean the content of folder C:\Documents and Settings\All Users\Dados de aplicativos\Microsoft Visual Studio\10.0\TraceDebugging\ (Location of Intellitrace Recordings)

# December 12, 2010 1:07 PM

Washington said:

Tks man. your tip saved my day

# January 29, 2011 2:42 PM

Omar said:

Thanks, It worked perfectly!

# February 8, 2011 12:36 PM

tester said:

John Walker solution worked for me

# March 7, 2011 9:24 PM

mj_developer said:

Thank you. My problem was solved.

# March 13, 2011 4:06 AM

Mutahar said:

Great solution, btw for Windows 7 the Temp file diectory is same as of Windows XP that is %WINDIR%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

# March 21, 2011 8:11 AM

Pramod said:

wow!!! you saved my day.. thanks a lot

# May 5, 2011 7:22 AM

Ed said:

I solved it by putting AjaxControlToolkit.dll in the Bin folder of my Visual Studio project.

# June 15, 2011 3:21 PM

Jay Ghadage said:

Awesome!  Thanks!

you saved my lot of work.

# July 3, 2011 5:44 AM

sami said:

I tried the following and it still giving me the same error message. Mine is running Windows XP Professional.

1. Clearing the temp .Net Folder

2. Giving folder access

3. Putting the "DLL" in the bin folder inside the project directory.

Can someone help me on this.

# July 25, 2011 10:58 AM

adilsari said:

Your solution worked perfectly, thanks so much!

# December 22, 2011 4:02 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)