Search code examples
web-partssharepoint-2013

SharePoint-specific WebPart-class (instead of System.Web.UI)


I just recently started using SharePoint 2013. I created the project using the built-in tools (Office Developer add-ons) as a SharePoint project.

I am porting a SharePoint 2010 project with a few webpart more or less file-by-file. The old webparts made use of the WebPart class found in Microsoft.SharePoint.WebPartPages.WebPart. According to MSDN, this should also exist in SharePoint 2013. However, it is NOT present (I get compiler errors).

My question is: Which DLL / using directive am I missing?

I tried using using Microsoft.SharePoint.WebPartPages (and inheriting from WebPart), but it still comes up as an error (using works fine though).


Solution

  • I figured it out. I had set up my project to be sandboxed, which disables some features including this specific WebPart-type. Re-creating the project as a non-sandboxed project made it work.