试图将VB中的.NET 2.0网站项目升级到4.5.2,这使得编译过程中出现了错误
BC30002 Type 'ScriptManager' is not defined.
BC30002 Type 'System.Web.Script.Services.ScriptMethod' is not defined.
BC30002 Type 'System.Web.Script.Services.ScriptService' is not defined.尝试了Import System.Web.UI,但它没有工作,并有一个警告说,导入是不必要的。System.Web.Extensions也是如此。
第一个错误发生在行上:
Public ReadOnly Property ScriptManagerObject() As ScriptManager
Get
Return Me.ScriptManager1
End Get
End Property成员在ASPX中定义为
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="AutoComplete.asmx" />
</Services>
</asp:ScriptManager>我应该怎么做才能将编译器指向ScriptManager等的正确命名空间?
编辑:
尝试将这一行添加到ASPX页面:
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web"%>不起作用。
尝试为4.0框架添加对System.Web.Extensions的引用。不起作用。
尝试从ASPX中删除ScriptManager1对象,并以相同的名称从工具箱中重新添加它。它仍未作为页面类的成员找到。我们怎样才能解开这个谜团?
发布于 2017-06-08 14:16:14
这就是答案:https://stackoverflow.com/a/19128973/2721750恢复到3.5,重复升级到4.5.2,显然它对web.config进行了更多的更改,并包含了更多的程序集引用,其中一些在最初的升级中可能被遗漏了。
https://stackoverflow.com/questions/44423479
复制相似问题