命名空间"Microsoft.SharePoint.WebControls"中不存在类型或命名空间名称"LayoutsPageBase"

Kia*_*nna 3 asp.net sharepoint visual-studio-2010 windows-server-2008 sharepoint-2010

我正在尝试使用Visual Studio 2010在SharePoint 2010网站上创建Web应用程序页面.我创建了一个新的应用程序页面而没有向其添加任何代码并获得此错误名称空间中不存在类型或命名空间名称"LayoutsPageBase" Microsoft.SharePoint.WebControls'.

Ric*_*ema 8

您是否将项目创建为Farm Solution或Sandbox Solution?

Microsoft.SharePoint.dll有两个版本.如果项目中引用的版本来自14\UserCode\assemblies,那么您使用的是沙盒版本.LayoutsPageBase类在沙箱解决方案中不可用.