Wednesday, April 4, 2012

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

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
Source: Joshua Johnson Blog

No comments:

Post a Comment