I'm trying to define the following variable in my C#, but am getting the missing using or assembly error.

private ListViewWebPart lvwp;

I'm including the below using statements. ListViewWebPart should be in Microsoft.SharePoint.WebPartPages. I do have the Microsoft.SharePoint reference.

using System;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

(SharePoint 2010, Visual Studio 2012)


Turns out I was using this in a sandboxed solution, which you can't do. Leaving this as an answer in case anyone else stares at this problem for 6 hours without figuring this out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.