I've discovered a problem when a Visual webpart's g.cs appears to be empty. I'm using Visual Studio 2012 Update 3 and a project for SharePoint 2010.
The steps to reproduce the problem:
- in Visual 2012, create a solution with two projects. The first one contains a user control. The second - a Visual Webpart;
- drag-and-drop the user control to the Visual Webpart's ASCX markup.
- ascx.g.cs file turns out to be empty
I've tried the same steps on different environments and the results are the same.
I know there are several workarounds like adding an old Visual Webpart template to the Visual Studio or adding controls from codebehind etc.
I am curious if there is a fix for that? I am pretty comfortable with these visual webparts and I wish I could continue using them. Thank you in advance!
Update: As incredible as it seems, this problem is still present in Visual Studio 2013...