Hi,
John said:
I have a few user controls in ascx files. I copied these files to the
deployment server. However the server gives error message that the code
behind (cs) are missing. I thought all cs files are compiled in the dll.
The web pages work if I copied the cs files. Why do I need to copy them
over?
John Dalberg
The deployment model changed in 2.0. You know have three options:
- Copy the ASCX, ASPX, ASMX files and also the CS files to the server.
The code-behind will be compiled on demand. This can be interesting for
web sites where parts of the site change often. This avoids recompiling
the whole site. Note that the code is protected because (normally), the
ASP.NET server refuses to serve code files.
- Publish the site using the "Build / Publish" menu. This precompiles
the website, and then deploys only the files needed to the web server.
- Use the web application project (WAP) template for VS2005. It's the
best suited model for web applications (as opposed to websites), but
it's also great for websites IMHO. It is closer to the 1.1 model, and
you have full control on the assembly, and on what gets published.
The WAP can be installed from here:
http://webproject.scottgu.com/
However, the WAP is included in VS2005 SP1, so you must uninstall it
before you install the SP1.
HTH,
Laurent