This is a migrated thread and some comments may be shown as answers.

Designer file ascx.g.cs is empty

2 Answers 538 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Ignatiuz
Top achievements
Rank 1
Ignatiuz asked on 17 May 2017, 11:47 AM

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.

Thanks,

 

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 19 May 2017, 01:58 PM

Hello,

Maintaining the designed files is something Visual Studio does and we cannot influence this. All we know about similar problems is listed here http://docs.telerik.com/devtools/aspnet-ajax/general-information/troubleshooting/design-time-troubleshooting#designer-files-are-not-updated-or-are-missing-telerik-controls.

Regards,

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.
0
Pistle
Top achievements
Rank 1
Veteran
answered on 01 Oct 2020, 12:21 PM
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”>
<Generator>SharePointWebPartCodeGenerator</Generator><LastGenOutput>DisplayWebPart1.ascx.g.cs</LastGenOutput>
</Content>
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.
Tags
WebParts for SharePoint
Asked by
Ignatiuz
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Pistle
Top achievements
Rank 1
Veteran
Share this question
or