问题
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’.
回答1:
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.
来源:https://stackoverflow.com/questions/7125717/the-type-or-namespace-name-layoutspagebase-does-not-exist-in-the-namespace-mi