Parser Error Message: The file '/TestSite/Default.aspx.cs' does not exist

In Default.aspx change CodeFile to CodeBehind. You'll probably have to do the same for the Site.master.

See: CodeFile and Code-Behind


Web Site projects use CodeFile, Web Application projects use CodeBehind. CodeFile requires the source file, it is compiled on the fly when the page is loaded, CodeBehind requires the compiled code.

My guess is that your problem was created when you changed your project type from a WebApp to a Web Site or vice-versa. If you do this, you have to manually change the directives in the existing files, new files will have the right directive automatically.

Tags:

C#

Asp.Net