1.Navigate Visual Webpart.
2. Right Click on VisualWebPart1UserControl.ascx file and click on Properties.
3.if VisualWebPart1UserControl.g.cs is present then delete it first.
4.Go To Custom Tool Text box on properties window and type “SharePointWebPartCodeGenerator” keyword and press enter. then it
automatically generate background file forcefully(VisualWebPart1UserControl.g.cs).