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

本文解决了在使用System.Web.Script.Services命名空间时遇到的'ScriptServiceAttribute'命名冲突问题。通过调整System.Web.Extensions组件的引用版本,成功修复了错误BC30560,并确保了网站Ajax功能的正常运行。

 

Im pretty sure that its because System.Web.Extensions.dll isnt up-to-date of isnt the latest version.

Im confused by the fact that I have two versions of System.Web.Extensions.dll installed on my computer one is version 3.5.0.0 and the other is version 1.0.61025.0. All i know is that one of these is from .NET3.5 and the other has installed with ASP.NET 2.0 AJAX Extensions, in my web.config all the refereneces seem to point to the ASP.NET 2.0 AJAX Extensions. I think its Http handlers need to changed. After adding the 3.5.0.0 it still hasnt worked. I cant understand why the bulit in Ajax Toolkit website handlers wont work.

To try to remedy this problem i have editied the web.config using both references but they didnt seem to work (together and singluarly).

 

Scenario:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30560: 'ScriptServiceAttribute' is ambiguous in the namespace 'System.Web.Script.Services'.
Source Error:

Line 12: <WebService(Namespace:="http://tempuri.org/")> _
Line 13: <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Line 14: <ScriptService()> _
Line 15: Public Class AutoComplete
Line 16:     Inherits System.Web.Services.WebService

Solution:

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.

REF:

http://forums.asp.net/t/1179216.aspx

http://www.kodyaz.com/articles/ScriptServiceAttribute-ambiguous-namespace-System-Web-Script-Services.aspx

http://www.telerik.com/community/forums/dotnetnuke/module-development/system-web-ui-ambiguous-namespace-issue-with-radeditor-on-dnn.aspx

转载于:https://www.cnblogs.com/emanlee/archive/2009/05/27/1491171.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值