Fixing Corrupted or Missing Designer Files in ASP.NET

Have you ever been working on a Web Forms project and you made a change only to build your project and find that the designer.cs file related to one of your forms had suddenly vanished or become corrupted; well here is a fix for that.

The Problem

One or more of the designer.cs files within your application is either missing or inaccessible due to unforeseen corruption.

The Solution

If the designer.cs file is inaccessible due to corruption or any other types of errors that could prevent you from accessing it, delete it. Don’t worry the next step will get it back.

Once the file is deleted or if it was already missing, you can easily resolve this issue by simply right-clicking on the Web Form in question and selecting Convert to Web Application option within the Solution Explorer.

This simple fix will regenerate any of the missing files that may have been giving you any additional grief due to their unexpected vacations.