An ASP.NET Blog
I work for Microsoft and help people and businesses make better use of technolgy to realize their full potential. The opinions mentioned herein are solely mine and do not reflect those of my employer.

ASP.NET Deployment - Files to be Deployed

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.


Feedback

# re: ASP.NET Deployment - Files to be Deployed

Thank you - to the point, and just what I needed! 7/23/2005 2:15 PM | matt

# re: ASP.NET Deployment - Files to be Deployed

Doesn't Global.asax need to be deployed as well? 10/5/2005 12:15 PM | steve

# re: ASP.NET Deployment - Files to be Deployed

Yes Global.asax needs to be deployed as well. You also need the aspnet_client folder.
12/21/2005 3:03 PM | sion

# re: ASP.NET Deployment - Files to be Deployed

Do you need .pdb files to be deployed on production? 4/28/2006 5:10 PM | Sheetal

# re: ASP.NET Deployment - Files to be Deployed

You should, in fact, copy the .pdb file to production IF/WHEN you have
exception handlers that make user of the stack trace (e.g., to log the exact
line of code that choked, thereby throwing the exception). If you are doing
this (I can't imagine why anyone wouldn't want this information in a
produciton system), then you will need to copy BOTH the .pdb and .dll file
whenever you recompile - as the .pdb version is logically tied to the .dll
version.

This is an answer from http://www.codecomments.com/archive289-2005-2-407432.html . I Hope it hepls. 5/19/2006 11:12 AM | Nicolás T

# re: ASP.NET Deployment - Files to be Deployed

Thanks for good knoledge, infact i was little confused for DLL and PDB files, but with above descussions its clear 6/5/2006 6:01 AM | Ravi

# re: ASP.NET Deployment - Files to be Deployed

most important page for any asp.net developer :) 11/13/2006 11:30 AM | sourabh

# re: ASP.NET Deployment - Files to be Deployed

Exactly what I was looking for 11/14/2006 12:50 PM | Shawn

# re: ASP.NET Deployment - Files to be Deployed

Thank You. Just What i needed 2/5/2007 12:53 PM | Mahesh

# re: ASP.NET Deployment - Files to be Deployed

I have made some changes to a class project, which is part of a web application solution. Please let me know the best way to implement these changes in the producion server. The project that has the aspx pages has its dll in the bin and 'references' all the other projects(including the class, I made changes to ).

Should I then zip this web project and ask them to replace the project under wwwroot with the updated one? Will the changes to the class be reflected?

I may, however, send the client a copy of the class project. Any information is greatly appreciated. 1/2/2008 4:12 AM | Sree

# re: ASP.NET Deployment - Files to be Deployed

Hi,
This is regarding the changed file getting moved to production.
I have made design and code change to a file which resulted in the changes of .aspx and .cs file. This is a sub-project which has its references to the mainproject/bin folder as well.
I want to move these two files to production.
I have steps in mind, please correct me if am wrong.
1. place those two files in the corresponding folder in the production server.
2. open the solution file, rebuild the the sub-project which undergone the change.
3. copy the sub-project dll and place in the mainproject/bin folder.
4. re-build the mainproject.
Is these above process correct or is there any other way of handling...please suggest.
Thanks,
Karthik
1/22/2008 1:47 AM | Karthik

# re: ASP.NET Deployment - Files to be Deployed

Can u give some article about 3 tier architechture 3/18/2008 1:30 AM | yasaswini

# re: ASP.NET Deployment - Files to be Deployed

thanks the simply for making understand these all in simple manner,really usefull information. 3/18/2008 5:48 PM | ANWER

Post a comment





 

Please add 1 and 8 and type the answer here: