My previous blog was based on my experience with “System.Web.Extensions” dll. You would have read the bucket full of hardships I had to face. This blog is continuation of the hardship I faced in the same project when I tried adding the Ajax Control toolkit for Visual Studio (VS 2005). This time I was lucky not to face too much problem.
As the project was using ASP.NET AJAX 1.0 controls I needed to install the same controls in the toolbox of VS so that I can use them in the project, also this will help me to just drag the controls and place them on ASP.NET pages. The steps to install the AJAX control toolkit for .NET Framework 2.0, ASP.NET AJAX 1.0 and Visual Studio 2005 are
Obviously the first step is to download the toolkit. So what you are waiting for, download the toolkit from here. (http://www.codeplex.com/AjaxControlToolkit/release/projectreleases.aspx?releaseid=11121)
Once you have downloaded the toolkit there are two ways in which you can proceed. Unpack/Unzip the whole contents or just find and unpack/unzip “AjaxControlToolkit.dll” alone.
Next, open VS 2005 and right click on the toolbox' and select “Add Tab” option from the menu and give a name.
Right click the new group and select “Choose Items” from the menu.
From the “Choose Toolbox Items” dialog box’s “.NET Framework Components” tab click the browse button. Navigate to the folder where you have unzipped the “AjaxControlToolkit.dll” (If you have Unpacked/Unzipped the whole content of the zip file then you can find the dll in “SampleWebSite\Bin” folder.). Select the “AjaxControlToolkit.dll” and click open.
Once you click open from Open File dialog box, “Choose Toolbox Items” dialog will highlight all the controls embedded in the dll. Finally select the control you want to add in the toolbox and click “Ok”. By default all the new controls will be highlighted and check marking one control will check mark the whole AJAX controls. The screen shot sorted based on the AJAX controls is pasted below.
After checking all the controls I clicked “Ok”. What the heck another error? My date with errors is not gonna get over in this project. Oh no!!
I tried once again but all in vain. The below error kept on popping up.
|“There was an error loading types from assembly 'C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\AjaxControlToolkit.dll’”|
Googling was in vain. Different combination of searches with different keywords didn't help either. I don't know what went in my mind, I opened another instance of VS 2005 and created a dummy web application and tried adding the AJAX Control’s dll and voila the controls got added. How weird, I was thinking? Oh Microsoft, I have heard people saying many weird things happen with Microsoft softwares, here I am facing one such thing. :) Anyway my prob was solved.
I went to the previously opened instance of VS to check whether the newly added toolbox had any impact. No, obviously there will be no impact, so to try my luck once again I followed the above steps to add the controls. But again the same error. What *#*#*$*&*##? Ok, let me close the current instance of VS and open a new instance and try it. I did the same, closed VS and opened a new instance of VS. Just to make sure that the project in which I am working is not the culprit I opened the project. On inspecting the toolbox there you have it, the “AjaxControlToolkit”. Wow at last everything is falling in place. After this incidence I concluded, in future, if I have some problem like this I will follow either of the steps listed below. I would request others also to do the same. Who knows when the system behaves so weirdly? Any one of the below step may solve your problem.
Try adding items to the current instance of VS, if that doesn't help then
Open a new instance of the software and try installing the items, if that also doesn't help then
Restart the system and try installing the items, if that also doesn't help then
Try reinstalling the software (VS) and then try once again, if that also doesn’t help then god bless you. :)
The last step of reinstalling VS was suggested by many in various forums and they have confirmed that reinstalling has solved their problem. Anyway one of the above steps should solve your problem.