A few days ago I was working on a web application and when I added a ScriptManager and a ScriptManagerProxy to the Master Page and Although the compilation was successful. I got the following error on the designer:
‘ScriptManager’ is ambiguous in the namespace ‘System.Web.UI’,
I said to my self: ah, probably another one of the Visual Studio glitches… so I pressed F5 and was proved wrong after getting the following runtime error:
Compiler Error Message: BC30560: ‘ScriptManager’ is ambiguous in the namespace ‘System.Web.UI’
After doing some checking I actually found the following error in the output:
errorCS0433:The type ‘System.Web.UI.ScriptManager’ exists in both ‘c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll’
and ‘c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.6.0.0__31bf3856ad364e35\System.Web.Extensions.dll’
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.
So if you have both installed, make sure you reference only one of them throughout your project.
Amit.
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More
Srikanth Said on Apr 16, 2008 :
Hi Sir,
I am also getting the same problem.Where can i remove these reference.Can you provide the total information of this?
Thanks,
Srikanth
Amit Said on Apr 16, 2008 :
Hi Srikanth
It can happen from various reasons.
you should check you GAC (C:\WINDOWS\assembly) to see how many installations of system.web.extentions you have, and what are their versions. Check it and get back to me I will try to help.
Amit
Srikanth Said on Apr 16, 2008 :
Hi amit,
I have system.web.extentions 3.5.0.0,1.0.61025.0,3.6.0.0 versions.
Actually i have installes both Ajax 3.5 and as well as ASP.NET 3.5 EXTENSIONS Controls
Please tell solution for my problem
Amit Said on Apr 16, 2008 :
Thats the problem.
They are both related to the same framework so the Visual Studio gets confused between them. you should remove one of them.
I recommend staying with the 3.5.0.0 one, that is what i am using and it works fine, though i think any of them will be OK.
Amit
srikanth Said on Apr 16, 2008 :
How can i remove the 3.6.0.0?Can i remove the total asp.net 3.5 extension tool?
Amit Said on Apr 16, 2008 :
Use this application:
http://msdn2.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx
it is for registering and removing dlls from the GAC
Amit
Fares Said on Apr 28, 2008 :
Try modifying the web.config of the application,
change the “System.Web.Extensions” assembly version from “3.6.0.0″ to “3.5.0.0″ or vice versa:
The key will look like the following:
<add assembly=”System.Web.Extensions, Version=3.5.0.0, …etc
OR
<add assembly=”System.Web.Extensions, Version=3.6.0.0, …etc
Roberta Said on Jun 5, 2008 :
I am not sure how to use this GAC to remove the extra versions. Where do I fing the Gacutil.exe. I did a search on C and did not locate it.
Shahar Y Said on Jun 5, 2008 :
Hi Roberta,
It is usually located in C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin but you may have installed Visual Studio in a different folder. So, find the anydir:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin
Roberta Said on Jun 5, 2008 :
thanks I found the file but now how do I uninstall the extra versions? I tryed though dos but that did not work
Shahar Y Said on Jun 5, 2008 :
Roerta,
You need to drag the gacutil.exe file into the command shell (cmd) and use the options you need.
You can read about the available options here:
http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx
Roberta Said on Jun 5, 2008 :
Hi Shahar Y
I did that and this is what I typed in
C:\>”C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe”system.
web.extensions.dll, version=1.061025.0,culture=”natural,PublicKeytoken=31bf3856a
d364e35
and this is what I got
‘”C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe”system.web
.extensions.dll’ is not recognized as an internal or external command,
operable program or batch file.
Roberta Said on Jun 5, 2008 :
I am not sure if this makes a diff or not but when I run the gacutil.exe /l the system.web.extensions do not show up but when I go to c:windows/assembly there are two there.
Shahar Y Said on Jun 5, 2008 :
Roberta,
1) I see that you forgot to add a space between the gacutil.exe and your assembly name.
2) You need to use some flag. If you want to uninstalls an assembly from the global assembly cache, you need to write - ”C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe” /u yourAssemblyName
Shahar Y Said on Jun 5, 2008 :
Hi Roberta,
About the fact that you can’t find the system.web.extensions assembly using the /l option - try to run “gacutil.exe /l system.web.extensions” and see if it can be found.
Roberta Said on Jun 5, 2008 :
Thanks I did that:
C:\>gacutil.exe /u “system.web.extensions, version=1.0.61025.0,culture=”natural”
,PublicKeytoken=31bf3856ad364e35
this is what I get
C:\>gacutil.exe /u “system.web.extensions, version=1.0.61025.0,culture=”natural”
,PublicKeytoken=31bf3856ad364e35
is there any other way to remove this?
Roberta Said on Jun 5, 2008 :
sorry this is what I get
Microsoft (R) .NET Global Assembly Cache Utility. Version 1.0.3705.0
Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.
No assemblies found that match: system.web.extensions, version=1.0.61025.0,cultu
re=natural,PublicKeytoken=31bf3856ad364e35
Number of items uninstalled = 0
Number of failures = 0
Roberta Said on Jun 5, 2008 :
it is not listed in the /l at all
Roberta Said on Jun 5, 2008 :
this is what I get
C:\>gacutil.exe /l “system.web.extensions
Microsoft (R) .NET Global Assembly Cache Utility. Version 1.0.3705.0
Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.
The Global Assembly Cache contains the following assemblies:
The cache of ngen files contains the following entries:
Number of items = 0
Shahar Y Said on Jun 5, 2008 :
Roberta,
1) You wrote natural instead of neutral.
2) Not sure if it matters, but you didn’t use spaces and capital letters.
Try to write it like that: system.web.extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Roberta Said on Jun 5, 2008 :
ok thanks:~) I rewrote it and now it is telling me
invalid file or assembly name
that I need a .dll or .exe
Just to make sure I am getting the assembly name from C:\WINDOWS\assembly is that right?
Shahar Y Said on Jun 5, 2008 :
Roberta,
If ”C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe” /u system.web.extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 doesn’t work, it is weird and sorry but I have no ideas left…
Roberta Said on Jun 5, 2008 :
ok thanks for all your help. :~)
Jeff Said on Jan 25, 2009 :
Thanks so much! Stupid VWD 2008 adds the 3.5 reference automatically. Good old Microsoft
Thanks again!
omyfish Said on Jun 26, 2009 :
This work for me.
gacutil.exe /u “system.web.extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″