类型或命名空间名称“LayoutsPageBase”命名空间“Microsoft.SharePoint.WebControls”中不存在;
我正在尝试使用 Visual Studio 2010 在 SharePoint 2010 网站上创建 Web 应用程序页面。我创建了一个新的应用程序页面,但未向其中添加任何代码,并收到此错误:类型或命名空间名称“LayoutsPageBase”在命名空间“中不存在” Microsoft.SharePoint.WebControls'。
I am attempting to create a web application page on a SharePoint 2010 site using Visual Studio 2010. I created a new application page without adding any code to it and get this error The type or namespace name ‘LayoutsPageBase’ does not exist in the namespace ‘Microsoft.SharePoint.WebControls’.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将项目创建为农场解决方案还是沙盒解决方案?
Microsoft.SharePoint.dll 有两个版本。如果您在项目中引用的版本来自 14\UserCode\assemblies,则您使用的是沙盒版本。 LayoutsPageBase 类在沙盒解决方案中不可用。
Did you create your project as a Farm Solution or Sandbox Solution?
There are two versions of Microsoft.SharePoint.dll. If the version you have referenced in your project is from 14\UserCode\assemblies, then you are using the sandbox version. The LayoutsPageBase class is not available in sandbox solutions.