The type 'System.Web.UI.ScriptManager' is ambiguous: it could come from assembly...

If you are trying to migrate an old application to work with the framework 3.5,  you are using ajax, and get the following error...

 The type 'System.Web.UI.ScriptManager' is ambiguous: it could come from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll' or from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll'. Please specify the assembly explicitly in the type name.

 

You need to delete all your \bin files and rebuild the application.

 

 

25 Comments

  • You can add assembly binding redirects to your Web.config to avoid this problem coming back after you delete your /bin files and rebuild. What it does is redirect any requests for the 1.0 version of AJAX for ASP.NET to the 3.5 version.












  • Problem solved. Thanks for your help.

  • Also make sure to check C:\Windows\assembly.
    If you see both 1.0 and 3.5, remove one of them.

  • In our case we're having the same problem on a .NET 2.0 framework based application.
    Can't we just tell IIS/.NET to use the 2.0 version for this application? Avoiding rebuilding everything.

    Some extra information: We have applications running on 3.5 and 2.0 which should share the same website but would use different application memory pools.

  • Hi,
    Thanks a lot!..I found this very useful..

    Cheers!

  • Thank you sooooo much, it worked perfectly. I added the following to my web.config
























  • Tnx... i owe u a lot... mwah!

  • i try all these solution but the problem still exists
    the solutions i tried:

    1- delete all your \bin files and rebuild the application
    2-update my web.config


























    3-remove one of 1.0 and 3.5

    C:\Windows\assembly.


  • reset the IIS it works sometimes

  • Thank a lot. It solved my problem OK. Great post.

  • The following is the error , i am using asp.net 2005
    -------------------------------------------------------
    The server tag 'asp:ScriptManager' is ambiguous. Please modify the associated registration that is causing ambiguity and pick a new tag prefix.


  • Plz Reply at prabodh.bansal2@yahoo.com

    Regards
    Prabodh

  • Oh my god@ very nice

  • It just a GREAT POST.

    Thanks A LOT :))

  • Thanks a lot.This works nicely.

  • Comment this line in web config file


  • Thanks a lot!

  • Thank you so much Javier !!!

  • This blog isn't the whole story. You have to comment out v1.0.61025.0 of System.Web.Extensions and System.Web.Extensions.Design from your web.config. Then you have to remove them using gacutil (in C:\Program Files\Visual Studio 8\SDK\bin folder, if you have VS 2005), or in C:\Windows\Microsoft.NET\Framework\v1.1* folder of that version's .NET Framework Redistributable. You should use quotes around your removal command, like this: gacutil -u "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35". If you have other things using it, I'd like to see others' responses on how to deal with that part...

  • Actually I figured out how to remove references, though Microsoft's way of doing gacutil /u /r "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" FILEPATH C:\WINDOWS\system32\msiexec.exe "Windows Installer" didn't work for me, when it was being held onto by Windows Installer. Had to search for System.Web.Extensions in the registry. Found 2 entries (one for the base, one for .Designs) at HKEY_CURRENT_USER\Software\Microsoft\Installer\Assemblies\Global and removed them. Then I could get rid of the v1.0 DLLs. Hope this helps someone.

  • Hey i too had the same problem.I went to toolbox,right clicked to add items
    in that i removed the references for updatepanel 3.5 and added 1.0
    similary for script manager and other conttrols.
    after this i added the following line of code on top of aspx page

  • If you right click on the project,go to property pages remove reference to version 3.5.0.0 , this worked for me.

  • thank u for your solution .. salved alot of my time :D

  • Comment this line in web config file

  • Hey there just wanted to give you a brief heads up and let you know a few of the pictures aren't loading properly. I'm not sure why but I think its a linking issue. I've tried it in two different browsers and both show the same results.

Comments have been disabled for this content.