Sometimes when I’m using Microsoft Visual Studio for my web applications, I find that it gets it’s knickers in a twist over designer files. Designer files are generated by Visual Studio and are used to allow you to create a class which has code in multiple files (known as partial classes).
It’s actually very easy to regenerate designer files (or restore them should you have deleted them) once you know how. Just follow these simple steps:
- If it is not already removed, deleted the designer.cs file. You can do this by right clicking on it within Solution Explorer and selecting ‘Delete’.
- Right click on the aspx/ascx page which you need to create a new designer file for.
- Select the ‘Convert to Web Application’
And, hey presto, a fresh, new trouble-free designer.cs file which won’t cause problems with your build!
Tags: asp.net, aspx, c#, deleted, designer, designer.cs, regenerate, restore, vbnet


Leave a Reply