‘ScriptManager’ is ambiguous in the namespace ‘System.Web.UI’
I suddenly found myself getting this error the first time I tried to run a freshly minted ASP.NET 3.5 web site with the ScriptManager in place on the Master Pages. I did a quick search, but only found some references from the time before 3.5, and they did not seem to apply at all. I continued my search for an answer and came across an article by Amit where he discovered the ambiguous ScriptManager error.
Well, that was the end, as it turns out I had installed both the Ajax that comes with the .NET 3.5 and the Ajax that comes with ASP.NET 3.5 Extensions, and I had referenced them both! All I needed to do was to remove one of the references and that’s it.
Yep, sure enough I was referencing the 3.6 version of the System.Web.Extensions library. But I was not exactly sure where to verify that was the problem, so I wanted to share with you where to look.
On the Yellow Screen of Death (the page displayed when you have an unhandled exception) You will see a hyperlink to expand a section to get more detail. If you click it you will get some pretty good exception information. I wish I could now replicate the error so I could give you a screenshot. But the first line of information is really quite long and it is the one you need to pay attention to. I copied it and pasted it into Notepad with word wrapping enabled. Somewhere at the top of the information you will find your verification:
/R:"C:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.6.0.0__31bf3856ad364e35\System.Web.Extensions.dll"
This is easy enough to rectify, open the references for the web site and you will find both references to a System.Web.Extensions.dll. You can do this by selecting 'Properties' from the context menu invoked by Right-Clicking at the root of the web site in the Solution window of Visual Studio. Remove the reference to the 3.6 version of the dll and you should be fine.