C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




ASP.NET 2.0 Deployment Options


Posted Date: 19 May 2008    Resource Type: Articles    Category: .NET Framework
Author: Abhishek AryaMember Level: Diamond    
Rating: Points: 0



After developing a web application we have to deploy it. With 1.1 version we have a option of Setup and Deployment Wizard and that was the way we were able to create a setup file. In VS 2005 we have various options let see how it works
1) Web Setup Deployment
Here are step by Step for creating Web setup Project

1. Open your website in Visual Studio 2005
2. Right Click on the Solution Name Select "Other Project Types" and expand the same. Select "Setup and Deployment" and in the available Templates select "Web Setup Project" and provide a name ex. "WebSetup1" to create the project in the location of your choice

3. Right Click on the "WebSetup1" created above and choose "Add - Project Output" You would be able to see it lists out the available project in the "Project" dropdown. The only option you would find here is "Content Files". Here is where you find the difference. In Visual Studio .NET and ASP.NET 1.x verions you would need to add "Primary Output" option which is the assembly created for your Website. Here in ASP.NET 2.0 there is no default Website Assembly (in other words DLL File and BIN Folder) unless you explicitly create a BIN folder. Hence you just need to select "Content Files" which will bundle up ASPX, Codebehind, Resource Files, Images, Folders etc.
4.Once you are done with adding the required Project Output, Right Click on the "WebSetup1" project and "Build" it. It would create the installer file (MSI File) that can be used for installing your application on different machines.

Make sure you select "Release" Mode in Visual Studio 2005 before creating the Web Setup since that would optimize the binaries for performance.

2) Website Publish Wizard Deployment

Visual Studio 2005 also provides you with a new "Web Publish Wizard" option where you can publish your websites files to a different machine / directory to a HTTP / FTP or a file share of your choice.
Below are the steps

1. Right Click on your Web Project and select "Publish Web Site". It will prompt you with a "Publish Web Site" dialog where you can specify the path to be published.
2. The ASPX pages, Images etc., and other markup files are copied to the location specified AS IS.
3. You would also find a PreCompiledApp.Config file.
This option is pretty handy if you keep updating the site to a Staging Server on a regular basis since it would not be creating MSI file on day to day basis.

3) Copy Website Deployment

The Copy Website provides you an option to simply copy the source files to a destination folder which can either be on your local machine or an FTP / HTTP Location. The difference in this case is that, the Website is not precompiled. Your Website is copied AS IS and all the files include the code behind files are copied to the destination.
Here are the Steps below

1. Select your Website Project, Right Click and select "Copy Website"

2. It provides with you an interface listing the "Source" in the left and provides you the option to "Connect" using the "Connect" option to specify the destination. However, it can also be vice versa since you can select "Source" to be your destination location and do a copy back to your local folder as well.

3. The "Synchronize" button helps you to keep the files synchronized. There is also a Log that is created which can be viewed from this interface. In simple terms Copy Website Deployment is deploying the files as is with source/destination file synchronization.

5) PreCompiled Web Deployment

With all of these options above, you also can manually precompile the whole application using the PreCompilation tool installed with ASP.NET 2.0. Steps herebelow:-

1. Type "cmd" from Run command to open the Command Prompt

2. Navigate (Change Directory - cd) to %windir%\Microsoft.NET\Framework\v2.0.50727

3. Type aspnet_compiler -v /"Your Website Name" -p "Physical Path to your site" "Physical Path to Deployment Location"

4. An ideal example of above would be aspnet_compiler -v /Website1 -p "D:\Projects\Website1" "D:\PreComiled Website1"

5. There are multiple switches which you can try in the above command. You can verify all the options by typing aspnet_compiler -? from %windir%\Microsoft.NET\Framework\v2.0.50727\

Once you run the above command you would notice that in the Deployed location, all the files including ASPX, ASCX are precompiled and dont contain any markup.




Responses

Author: Mahesh Raj    07 Jun 2008Member Level: Gold   Points : 1
This is very good information,Continue posting such useful articles.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: ASP.NET 2.0 Features
Previous Resource: PageStatePersister class in 2.0 - To persist state on page or Session or even on Database.
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use