Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. The system cannot find the file specified

I am working on sharepoint 2010. I have created a simple visual web part which contain one text box and I have added calendarextender to it. I have added ajaxcontroltoolkit.dll as reference. But when I deploy to sharepoint site then it gives me following error.

“Parser Error” Message:

Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 3: <%@ Register Assembly=”AjaxControlToolkit”> Namespace=”AjaxControlToolkit” TagPrefix=”cc1″ %>

Source File:

/_CONTROLTEMPLATES/VWP_Ajax/VisualWebPart1/VisualWebPart1UserControl.ascx Line: 9

Any ideas where Im going wrong?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Is the AjaxControlToolkit.dll in the bin directory after you deploy the site?

The assembly (AjaxControlToolkit.dll) needs to be deployed to the Global Assembly Cache (GAC) or put in the BIN folder of the SharePoint site’s folder.

Method 2

This definitely worked for me with SharePoint 2010 …

Error Code:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"  TagPrefix="ajaxControlToolkit"%>

Working Code:

<%@ Register Assembly="AjaxControlToolkit, Version=3.5.60501.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit"  TagPrefix="ajaxControlToolkit"%>

Method 3

Another possible solution is to explicitly set the full assembly name in your register command. I found that I had to update my code to include this to get it to work properly:

<%@ Register Assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

For third-party controls like this, it’s worth being as specific as possible to avoid any errors if versions change.

Method 4

Even you tried above and it wont work, Just add another Page/MasterPage and add ToolKitScriptManager on it.It will create Bin Folder at required path. If still there is Error check the Register Assembly line on newly added page/MasterPage and copy that Register Assembly line to other pages wherever your error is.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x