我在尝试在ASP.NET MVC应用程序的文件夹中显示ASP.NET Web表单页面时收到此错误。我错过了装配参考或包装吗?
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load type 'System.UI.Page'.
Source Error:
Line 324: </mobileControls>
Line 325:
Line 326: <pages pageBaseType="System.UI.Page" userControlBaseType="System.UI.UserControl">
Line 327: <namespaces>
Line 328: <add namespace="System" />
Source File: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config Line: 326
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212
答案 0 :(得分:1)
Page不在System.UI
中。它位于System.Web.UI
程序集中的System.Web
命名空间中。您应默认引用System.Web
,因此只需在web.config
中修复完全限定名称即可。同样适用于UserControl
类。
<pages pageBaseType="System.Web.UI.Page" userControlBaseType="System.Web.UI.UserControl">