I am trying to deploy a simple ASP.NET 4.0 Web Application on IIS 6.0 on Windows Server 2003.
I've copied all of the files over, including the bin folder and files Play.aspx, Play.aspx.cs and Play.aspx.designer.cs.
I get the following error when I try to access Play.aspx in the browser:
Compiler Error Message: CS0103: The name 'divOutput' does not exist in the current context
and then it quotes a line from my Play.aspx.cs file.
Now, divOutput does exist in the Play.aspx.designer.cs file. Why is the ASP.NET compiler on the server not picking this up? (And anyway, I've copied the bin folder, so why is it even trying to compile anything in the first place?)
Deploying source to a server is rarely (as in Never) a good idea and usually the wrong way to do things.
Use the Publish command in visual studio. This will compile and deploy for you.
Make sure that your codebehind and designer share the same classname. Sometimes if you rename stuff manually this can get out of whack.
Ensure that the designer is included in the project.
Make sure that the aspx references the proper code behind and class name.