Deploying Your Website Using Visual Studio
The preceding tutorial looked at how to deploy a simple ASP.NET web application to a web
host provider. Specifically, the tutorial showed how to use an FTP client like FileZilla to
transfer the necessary files from the development environment to the production
environment. Visual Studio also offers built-in tools to facilitate deployment to a web host
provider. This tutorial examines two of these tools: the Copy Web Site tool, where you can
move files to and from a remote web server using FTP or FrontPage Server Extensions; and
the Publish tool, which copies the entire website to a specified location.
Note: Other deployment-related tools offered by Visual Studio include Web Setup
and Web Deployment Projects
Add-In. Web Setup Projects package a
website's contents and configuration information into a single MSI file. This option is
most useful for websites that are deployed within an intranet or for companies that
sell a pre-packaged web application that customers install on their own web servers.
The Web Deployment Projects Add-In is a Visual Studio Add-In that facilitates
specifying configuration differences between builds for development environments
and production environments. Web Setup Projects are not discussed in this tutorial
series; Web Deployment Projects are summarized in the Common Configuration
Differences Between Development and Production tutorial.
Deploying Your Site Using the Copy Web Site
Visual Studio's Copy Web Site tool is similar in functionality to a stand-alone FTP client. In a
nutshell, the Copy Web Site tool allows you to connect to a remote web site through FTP or
FrontPage Server Extensions. Similar to FileZilla's user interface, the Copy Web Site user
interface consists of two panes: the left pane lists the local files while the right pane lists
those files on the destination server.
Note: The Copy Web Site tool is only available for Web Site Projects. Visual Studio
does offer this tool when you are working with a Web Application Project.
Let's take a look at using the Copy Web Site tool to publish the Book Review application to
production. Because the Copy Web Site tool only works with projects that use the Web Site
Project model we can only examine using this tool with the BookReviewsWSP project. Open
Launch the Copy Web Site tool project by clicking the Copy Web Site icon in the Solution
Explorer (this icon is circled in Figure 1); alternatively, you can select the Copy Web Site
option from the Website menu. Either approach launches the Copy Web Site user interface