Error Messages

From tekkies.co.uk
Jump to: navigation, search

Parser Error Message: The file [filename].aspx.cs does not exist.

Problem: After deploying an ASP.NET site, I got an error that was not present when debugging:

Parser Error Message: The file [filename].aspx.cs does not exist.

Cause: I had manually added [filename].aspx and [filename].aspx.cs to my solution, but did not have a [filename].aspx.designer.cs - as it turned out I didn't have the missing file, so I managed to regenerate it.

Solution:

  • In Visual Studio, rename [filename].aspx to [filename2].aspx
  • Create new form [filename].aspx (This creates new aspx, asp.cs and asp.designer.cs files)
  • Paste contents of [filename2].aspx.cs into [filename].aspx.cs
  • Paste all but top line of [filename2].aspx to [filename].aspx