Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Deploying Web Sites Using Visual Studio 2005

0.00/5 (No votes)
19 Oct 2008 1  
This Article Describe Various Way To Deploy Your ASP.Net Sites On IIS using Visual Studio 2005 IDE

 

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here