I am brand new to SharePoint, SharePoint development, and MS development.
My SharePoint dev environment consists of Windows 2008, SharePoint 2010, and Visual Studio 2010.
I created a very simple "Hello World" Visual WebPart, deployed it to SharePoint through Visual Studio, added it to a new page, and was able to view it with no problem.
I then enhanced the WebPart by adding a few controls and some code. When I deployed the Web Part, and went to the page containing it, I received an error in Visual Studio: "HttpCompileException was unhandled by user code".
I then erased all of my new code, so that the XXXUserControl.ascx file contains only a single button and the XXXUserControl.ascx.cs file contains only an empty Page_Load method. I deployed again, but received the same error.
I'm looking either for an explanation of what's happening, or tips on how to debug.
Details:
The error is: "HttpCompileException was unhandled by user code"
The error occurs in the auto-generated XXXWebPart.cs file on the line marked with "<-----" below:
namespace UserSyncTest1.UserSyncTest1WebPart
{
[ToolboxItemAttribute(false)]
public class UserSyncTest1WebPart : WebPart
{
// Visual Studio might automatically update this path when you change the Visual Web Part project item.
private const string _ascxPath = @"~/_CONTROLTEMPLATES/UserSyncTest1/UserSyncTest1WebPart/UserSyncTest1WebPartUserControl.ascx";
protected override void CreateChildControls()
{
Control control = Page.LoadControl(_ascxPath); <-----
Controls.Add(control);
}
}
}
The output window contains:
A first chance exception of type 'System.Web.HttpCompileException' occurred in System.Web.dll
