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

时间:2011-08-19 18:21:33

标签: asp.net visual-studio-2010 sharepoint sharepoint-2010 windows-server-2008

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

1 个答案:

答案 0 :(得分:8)

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

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