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.
By Srikanth on Apr 16, 2008 | Reply
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
By Amit on Apr 16, 2008 | Reply
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
By Srikanth on Apr 16, 2008 | Reply
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
By Amit on Apr 16, 2008 | Reply
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
By srikanth on Apr 16, 2008 | Reply
How can i remove the 3.6.0.0?Can i remove the total asp.net 3.5 extension tool?
By Amit on Apr 16, 2008 | Reply
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
By Fares on Apr 28, 2008 | Reply
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
By Roberta on Jun 5, 2008 | Reply
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.
By Shahar Y on Jun 5, 2008 | Reply
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
By Roberta on Jun 5, 2008 | Reply
thanks I found the file but now how do I uninstall the extra versions? I tryed though dos but that did not work
By Shahar Y on Jun 5, 2008 | Reply
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
By Roberta on Jun 5, 2008 | Reply
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.
By Roberta on Jun 5, 2008 | Reply
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.
By Shahar Y on Jun 5, 2008 | Reply
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
By Shahar Y on Jun 5, 2008 | Reply
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.
By Roberta on Jun 5, 2008 | Reply
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?
By Roberta on Jun 5, 2008 | Reply
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
By Roberta on Jun 5, 2008 | Reply
it is not listed in the /l at all
By Roberta on Jun 5, 2008 | Reply
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
By Shahar Y on Jun 5, 2008 | Reply
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
By Roberta on Jun 5, 2008 | Reply
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?
By Shahar Y on Jun 5, 2008 | Reply
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…
By Roberta on Jun 5, 2008 | Reply
ok thanks for all your help. :~)