“ScriptServiceAttribute”在命名空间“System.Web.Script.Services”中不明确;
我目前正在开发一个现有的 ASP.NET 项目。目前我必须整合 一个新的组件,因此为此目的我必须将框架目标从 2.0 更改为 3.5。重新生成解决方案后,我现在正在处理一个奇怪的问题。
这是代码:
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<System.Web.Script.Services.ScriptService()> _
最后一行返回该错误:
'ScriptServiceAttribute' is ambiguous in the namespace 'System.Web.Script.Services'
我绝对不知道我的代码中发生了什么?!这是 ScriptService 构造函数的内部错误吗?
预先感谢您的帮助!
I'm currently working on an existing ASP.NET project. At the moment I have to integrate
a new componant so for that purpose I had to change the framework target from 2.0 to 3.5. After regenerating the solution, I'm now dealing with a strange issue.
Here's the code :
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<System.Web.Script.Services.ScriptService()> _
And the last line returns that error :
'ScriptServiceAttribute' is ambiguous in the namespace 'System.Web.Script.Services'
I have definitely no clue what's going on in my code ?! Is it an internal error of the ScriptService constructor ?
Thanks in advance for your help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须引用两个不同版本的 System.Web.Extensions 程序集。检查您的项目引用,并确保 web.config 的
部分中配置的所有内容均一致。此外,您可能需要检查服务中是否有显式的@Register
语句,该语句可能具有不匹配的版本号。You must have a reference to two different versions of the System.Web.Extensions assembly. Check both your project reference as well as to make sure that whatever is configured in the
<compilation>
section of your web.config are aligned. Also you might want to check if you have an explicit@Register
statement in your service that might have a mismatched version number.我检查了我的参考资料,似乎一切正常!我还检查了 web.config,但找不到任何问题。关于 @Register 声明,我真的不知道在哪里可以找到任何东西,因为这不是我自己的项目,而且我不知道可以在哪里使用该服务。
I checked my reference and it seems everything is alright ! I also checked the web.config and I cannot figure out any issues. Concerning a @Register statement, I don't really where could I find any as this is not my own project and I don't know where this service could be used.