ASP.Net designer.cs Not Auto Updating

By Akbar

If you use the ASP.Net Web Application project, then there are chances that you have to face a problem, where the designer.cs for the wep page stop auto upadating as you add the new controls to the page. When this happens, it’s really frustrating as you don’t get the error on why it’s not being auto updated. Plus I can’t seem to find some intutive for force regenerate this too.

Today was one such day. I ended up wasting around an hour on the issue where the designer.cs was not being updating for new controls for the Site.Master page. Usually when this happens, the trick which works for me is that I manually add a new ASP.Net server control, switch to the designer.cs and save it. It works almost 99% of the time.

However today was a bad day (that 1% time), where the above solution didn’t worked. Tired up, I started reviewing all the ASP.Net server tags (have to remove couple of those too), and finally found the issue. The problem was that one of the ASP.Net custom control tag was mis-spelled. Once I fixed that typo, the designer.cs started updating correctly. But what was frustrating that there was no error for this, instead the designer.cs just stopped auto updating after that control.

During all this research (and frustrating) process, I found the following nice tip to force regnerate the designer.cs file:

1) Right-Click the designer.cs file and then select ‘Delete’
2) Once the designer file is created, select on the main .aspx, .ascx or .master page, right-click and select ‘Convert to Web Application’.
3) See the magic.

If there was an error due to which the designer.cs file was not being auto updated, you should see the detail of that error too. Yeah!

Tags: , ,