Click here to Skip to main content
6,295,667 members and growing! (14,916 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Intermediate License: The Code Project Open License (CPOL)

Deploying Web Sites Using Visual Studio 2005

By Abhijit Jana

This Article Describe Various Way To Deploy Your ASP.Net Sites On IIS using Visual Studio 2005 IDE
Windows, ASP.NET, Architect, Dev
Posted:19 Oct 2008
Views:8,651
Bookmarked:27 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
24 votes for this article.
Popularity: 5.27 Rating: 3.82 out of 5
2 votes, 8.3%
1
3 votes, 12.5%
2
1 vote, 4.2%
3
3 votes, 12.5%
4
15 votes, 62.5%
5

 

Introduction :

Visual Studio 2005 IDE provides us some useful way to deploy our web sites on Web Server (IIS).  Maximum times we are going to deploy our application by creating Virtual Directory on IIS and this is the best way to deploy . But some times we need to do deploy our applications directly from VS also. Visual Studio includes features that integrate with IIS and allow us to create Virtual Directories with in Visual Studio IDE.

Visual Studio Provides Three Important Features to deploy our web sites

  • Creating virtual directory at the time of creating new web project
  • Using Copy Web Tool
  • Publishing web site

Creating Virtual Directory At The Time Of Creating New Web Project :

From Visual Studio when we are create a web sites simultaneously create a virtual directory for that web sites. In General case we create a web sites in our local system and Visual Studio used it own built in web server to run that application. But if we want do so , Visual Studio won't use its Built-in web server to deploy the sites rather that a Request will send to IIS and then IIS will taking care of  it. Now Let See, How to do so.

Steps:

  1.   Visual Studio  > File > New Web Sites

VS20054.jpg

         In that Screen , Select HTTP in Location Field instead of  File System (By Default) . Now Just Write the URL for that application ,as given in picture. Visual Studio will create a Virtual Directory on IIS with named "mydemosites" .  Now If that Virtual Directory already exists , It will not create  it, it will just use the existing one.

2. Click on OK. Check the Solution path . its is in local host

VS20053.jpg

Visual Studio Does nor provide limited number of functionality of IIS Manager. We can create a Virtual Directory with existing application.

Step :

  1. Click on Browse Button of New Window [ shown in First Image ] 

  2. Select Default Web Sites

VS20055.jpg

   3. Click On Create Virtual Directory, Give Alias name and Folder Path

VS20056.jpg

Now, This approach has certain limitation,

Limitation :

  • If Development and production environment is same then all the changes in your application directly affected to live environment which is not at all preferable.

  • Virtual  Directory will be created at the time of Starting of you application. We don't have any option to create virtual directory in that way for an existing application.

  • Application Location should be C:/inetpub/wwwroot, which some times not preferable to manages all other resources of your application.

  • We can't configure other settings like ,  Authentication Settings, Default Pages, Custom Errors etc

Using Copy Web Tool :

Visual Studio also provide another useful control transfer our web application files directly from Visual Studio.

Steps:

1.  Your  Web Sites > Right Click > Copy Web Site.

2. Click on Copy Web Site... Following Screen will come

VS20059.jpg

In copy web tool , There are two window, one is current location, which is our local solution file and another id remote site that is our target location. First of all we have to set the target server , to enable the area.  For that we need to click on Connect

VS200510.jpg

Now , a new window will come , using which we can specify location for remote web site

  • File System: Remote location will be the local system or may be network folder, it will just create a new folder to store the application.

  • Local IIS :  Create Virtual Directory on IIS under default web sites. we can also create new virtual directory as shown earlier.

  • FTP Site : It is used for FTP site, we need to configure FTP for that

  • Remote Site: We have to specify the remote sites URL  for copying the file

VS200511.jpg

After  , Specify the Location , we will have the enabled Remote Server Section and enabled button to copy files.

VS200512.jpg

Publishing web site :

This features gives us to deploying our application to a production server and keep the source code secure Visual Studio Publishing Features use aspnet_complier command line utility to secure our code. it will just publish the sites with compiling that code. we just need to deploy the it on IIS server. There are only a few steps.

Steps :

  1. Right Click on Web Site > Publish Web Site

VS200513.jpg

2. Set the location for your publishing, you can directly Deploy to IIS or the set location as earlier that already discussed., Check the allow this precompiled site to updateable, this will help you to change effects on client site code on you live site with out recompile.e.g, suppose you need to change a alert message , for that just change on client code and it will reflected on live sites , for that you do not need to recompile

This are three approaches provide by the VS2005. Hope You enjoyed the article.

Point of Interest:

This are some quite interesting approches to deploy our application in IIS through Visual Studio

Reference:

Copy Web Tool MSDN

Publish Web Site MSDN

History:

Written on Sunday, Octbor 19, 2008

 

 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Abhijit Jana


Member
Abhijit has done Master Degree in Computer Application from Heritage Institute of Technology (HIT-K) ,Kolkata, West Bengal, India . He is an interested, committed, creative Software professional having more than 2 years of solid experience in web-based and windows based solutions in Microsoft Technologies using ASP.NET 2.0, C# 2.0, AJAX, Web Services, MS SQL Server 2005, Exchange Server, Active Directory, and Dot Net Nuke (DNN),Win Forms, WinServices, WSS (Windows Sharepoint Server 3.0 ). He is also an MCP (Microsoft Certified Professional) and MCTS (Microsoft Certified Technology Specialist) on Web Development. He has good knowledge of Object Oriented Programming, 3-Tier Architecture and Designing as well as good command over IIS (IIS 5.1,IIS 6.0, IIS 7.0) and deployment of Application on Live Production Environment . His hobbies, listing to music and Developing Own small Tools Utilities and Knowledge sharing.
Awards

CodeProject MVP 2009
Prize winner "Best ASP.NET article of January 2009"
Prize winner "Best ASP.NET article of November 2008"

Prize winner "Best ASP.NET article of October 2008"

Abhijit's CodeProject Guru :
Sacha Barber
Abhijit's Articles
View My CodeProject Articles


Mail Me @: mca_abhijit@yahoo.co.in

My Blog : http://abhijitjana.net
Occupation: Software Developer
Location: India India

Other popular ASP.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 19 Oct 2008
Editor:
Copyright 2008 by Abhijit Jana
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project