Designer file ascx.g.cs is empty

3 posts, 0 answers
  1. Ignatiuz
    Ignatiuz avatar
    9 posts
    Member since:
    May 2010

    Posted 17 May 2017 Link to this post

    We are working on a custom web form for SharePoint 2013. It is a visual web part and have a form which have several telerik controls. It is a big form. Earlier we developed it in Visual Studio 2012 and now we are working Visual Studio 2013. Now issue is, It is not generating designer file i.e. ascx.g.cs and giving error on every build. When we checked designer file, it is empty. We tried every possible solutions but not able to generate designer file and Visual Studio hangs if we open ascx file in design mode.

    Please help immediately.



  2. Marin Bratanov
    Marin Bratanov avatar
    5611 posts

    Posted 19 May 2017 Link to this post


    Maintaining the designed files is something Visual Studio does and we cannot influence this. All we know about similar problems is listed here


    Marin Bratanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Pistle
    Pistle avatar
    20 posts
    Member since:
    Sep 2020

    Posted 01 Oct Link to this post

    kindly try foolowing step and check if it works for you:-
    Make sure the Application Pool is running or reset IIS.
    Ensure the Project’s, not the Solution’s, “Site URL” is set to a valid SharePoint URL. (Impressive dependency, to regenerate your designer code locally, you need to have a valid working reachable SharePoint url)
    Right click on .ascx file, select Properties, and update the property “Custom Tool” to “SharePointWebPartCodeGenerator”.
    Right click on the .ascx file and click Run Custom Tool. At this point, if the “DisplayWebPart1.ascx.g.cs” is regenerated, your frustration is acceptable.
    Open the project.csproj file in Notepad++ or other editor, find the line DisplayWebPart1.ascx.g.cs
    You should see something like this:
    <Content Include=”DisplayWebPart\DisplayWebPart.ascx”>
    Change the LastGenOutput value to DisplayWebPart.ascx.g.cs
    Go back to Visual Studio 2012 and it asks to Reload the project (or Discard). 
    Reload the project
    Right click on .ascx file and Run Custom Tool again.
Back to Top