SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
ASP.NET, VB.NET, Microsoft .NET Framework, Microsoft Visual Studio, Windows Forms, Controls and more Tutorials and Articles for Programmers


error BC30560: 'ScriptServiceAttribute' is ambiguous in the namespace 'System.Web.Script.Services'.


In a recent web site project in which I call a web service within a web form, aspx page, I got the following error message when I tried to compile and build the web site.
In fact I got the error message when I copied the ASP.NET web site project to another computer, and after updating a web page and adding a new AjaxControlToolkit component onto the desing surface of the web form.

error BC30560: 'ScriptServiceAttribute' is ambiguous in the namespace 'System.Web.Script.Services'.





After the compilation error message, I realized that in the web.config configuration file, another System.Web.Extensions assembly record is added to the configuration file.
So two references to two different versions of System.Web.Extensions assembly file is the reason of ambiguous ScriptServiceAttribute in name space System.Web.Script.Services

Below is the assemblies section of the web.config file which is preventing the web site project to build successfully.

<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
Code

All you have to do in order to solve the error BC30560 indicating that 'ScriptServiceAttribute' is ambiguous in the namespace 'System.Web.Script.Services' is just commenting the proper System.Web.Extensions assembly according to their version numbers.



Visual Studio


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.