Monday, April 25, 2005 7:40 AM
This article refers to ASP.NET v1.x version. For updated version for ASP.NET 2.0, please check http://geekswithblogs.net/ranganh/archive/2007/07/31/114320.aspx
Many of us have this question of what are the files we need to publish when using FTP to move files to production server, for deploying an ASP.NET Web application.
The question obviously arises because when we use Visual Studio.NET to create a web application, there are many files created such AssemblyInfo.cs, Global.asax, Web.config, Proj file, codebehind files, resx files for each aspx page, etc.,
This article helps in understanding what are the files and why they are required for deployment.
1. ASPX files - These files are required as they hold the design as well as the controls declarations and these are the pages accessible by the users.
2. ASCX files - Usercontrols which form part of the pages.
3. BIN Folder - The BIN folder holds the key for an asp.net application. The DLL for the application lies within this folder and all the application logic you write in the codebehind files (.cs or .vb) are built into this DLL. The BIN folder has to be in the root of the directory and the DLL should be available within the BIN folder.
4. Web.config file - This is the configuration file for the application. Many settings such as Authentication, Session State, Authorization, Global Variables and other things can be set in this file. The advantage is that this file is an XML file and therefore doesnt require a compilation of the DLL after editing the file. It is advisable to store many configurable things like connection string, Database name, etc., in this file i.e. so that after deployment, changing these, doesnt require recompilation.
5. Other static files like CSS, JPG, GIF, XML, XSL Files also need to be published.
The following are the list of files NOT required to be published.
1. Codebehind files - .cs if c# and .vb if vb.net
2. RESX files
3. Proj file
4. Webinfo file
5. AssemblyInfo.cs or AssemblyInfo.vb
Cheers.