Wednesday, April 18, 2007

Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its ...

Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I just had a call from a client asking how we can solve this error while he was deploying his Intranet from his local machine to the production server. After a lot of searching he was linked to the MS site and asked to request a hotfix (FIX: You may receive an InvalidCastException error in an ASP.NET-connected Web application)

SYMPTOMS
loadTOCNode(1, 'symptoms');
You may receive an InvalidCastException error in a Microsoft ASP.NET-connected Web application when the following conditions are true:
• The Web application uses a master page, a user control, or pages that reference each other.
• The master page, the user control, or the pages are batch compiled into a single assembly.
• One of the batched dependencies is changed and causes a recompilation.
• A dynamic call to load a reference is made, such as a call to the LoadControl method. In this case, you may receive an error message that resembles the following:
Unable to cast object of type 'ASP.type' to type 'ASP.type'.Note In this error message, type is a placeholder for one of the batch compiled types. You may also receive an error message that resembles the following:
Could not load file or assembly 'App_Web_xxxxxxxx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Now he had been using master pages and webcontrols etc.. so the fix was tempting.. However as a precaution he called me and I looked deeper....
Enter ..... AJAX


Luckily I remembered he had just added AJAX to the site only a few days ago and so I dug some more. Finally tried out the site on a test server and reproduced the error but then I confirmed that installing the Ajax 2.0 Extensions would fix it..... and it DID!!

No comments: