Monday, June 15, 2009

CodeFile and Codebehind


I have the site that builds and runs perfectly on my development machine. It was created in Visual Studio 2008 and then ported to Visual Studio 2010, .NET 4.0. However, when I deploy it to the IIS, I got the very strange error message: Could not find Default.aspx.


Then I started investigation and found that the original error message was Parser Error Message: The file 'Default.aspx.cs' does not exist. The resolution for the problem is very simpple: just change the CodeFile to Codebehind in Default.aspx and republish the site.