SharePoint: Visual Studio 2012 and the 2010 SharePoint PowerTools Visual WebPart


Using Visual Studio 2012, you open a Visual Studio 2010 project which contains the “Visual Studio 2010 SharePoint Power Tools” Sandboxed Visual WebPart. On building your project you get a compiler error;

The name ‘InitialiseControl’ does not appear in the current context.

During the Visual Studio 2012 project/solution upgrade, one of the Visual WebPart designer files (.ascx.g.cs) was removed from the project (.csproj);

Missing Visual WebPart Designer File
Missing Visual WebPart Designer File

To resolve this situation, open and touch the .ascx file (you could simply add a newline) and save the file;

Open and Touch the .ascx File
Open and Touch the .ascx File

After saving, the missing designer file is restored, and you should now be able to build your project.

Published by

Phil Harding

SharePoint Consultant, Developer, Father, Husband and Climber.

2 thoughts on “SharePoint: Visual Studio 2012 and the 2010 SharePoint PowerTools Visual WebPart

  1. I had similar problem. When I set “Site URL” in project and re-create web part. Everything is ok:)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.