Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

HOW TO: Deploy an ASP.NET Web Application Using the Copy Project Feature in Visual Studio .NET


View products that this article applies to.

Summary

Visual Studio .Net provides Copy Project so that you can copy project files from one location to another during development, and so that you can deploy an ASP.NET project to the production Web server. This article describes how to use the Copy Project method in Microsoft Visual Studio .NET to deploy Microsoft ASP.NET Web applications. The article describes the following:
  • Connectivity methods for FrontPage Server Extensions (FPSE) and for shares.
  • The options in the tool to filter the files that you want to copy.
  • Server setup.
  • Other possible issues when you use Copy Project.

Set the Project to Release Mode Before You Perform the Copy Project

If you set the project to release mode before you perform Copy Project, that improves the performance of your ASP.NET application.

To set the project to release mode, follow these steps:
  1. Right-click Solution in Solution Explorer, and then point to Properties.
  2. Click the Configuration Properties folder in the left pane.
  3. Click the name of the project in the right pane, and then click Release on the Configuration dropdown menu.
  4. Click OK.

Steps to Perform a Copy Project in Visual Studio .NET

NOTE: To make sure that all the assemblies are up to date, you must perform a Build before you use Copy Project. If you do not, the ASP.NET application may deploy with older versions of some files.
  1. From the Project menu, click Copy Project.
  2. From the Copy Project dialog box, point to the Destination project folder that you want to use.
  3. Select a Web access method to connect to the destination folder. The Web access method choices are:
    • FrontPage - This method uses FrontPage Server Extensions (FPSE) over HTTP to transmit the files to the destination folder. Use this method when you transfer files to a server outside your local network. You must install the FPSE server.
      -or-
    • File share Universal Naming Convention (UNC) - To use this method, you must have direct access to the destination folder from the source folder. If the destination folder is on another computer, you must be able to locate that computer on your local network.
  4. Select a Copy option to specify which files you must copy to the destination folder. To do so, follow these steps:
    • Select the Only files needed to run this application option if you must deploy a completed ASP.NET application. You deploy DLLs and any files marked with a BuildAction of Content. You do not deploy source files that are unmarked.
    • Select the All project files option if you must include all build files, the project file, and the source files.
    • Select the All files in the source project folder option if you must copy all the files from the source folder.
    NOTE: If you frequently deploy changes, remember that Copy Project copies all the relevant files, whether or not those files changed since the last deployment.

Web Server Setup Requirements

Required Software
  • Microsoft Windows 2000 or Windows XP
  • Microsoft Internet Information Server (IIS)
  • Microsoft .NET Framework
To use Copy Project, you must set the project directory as an application in Microsoft Internet Information Services (IIS). To create an IIS application, follow these steps:
  1. Open Internet Services Manager. Or, if you run Microsoft Windows XP on your computer, open Internet Information Services.
  2. In the left pane, right-click the name of your virtual directory, and then click Properties.
  3. Make sure that the Web site name or the virtual directory name is listed in the Application Name box under Application Settings. If it is not listed, click Create.NOTE: If you selected the FrontPage Web access method in the Copy Project dialog box, you must install FrontPage Server Extensions (FPSE) on the Web server.

    For more information about installing FrontPage Server Extensions, visit the following Microsoft TechNet Web site:

    Installing FrontPage 2002 Server Extensions
    http://technet.microsoft.com/en-us/library/cc767983.aspx

Copy a Project to a Remote Server

Follow these steps to perform a Copy Project to a remote Web server:
  1. On the remote server, create a folder for all your Visual Studio .NET projects, for example: C:\Projects.
  2. Turn on file sharing for the C:\Projects directory.
  3. Create a subfolder in the C:\Projects directory with the name of the project that you want to copy, for example: c:\Projects\Test1.
  4. In the IIS management console, create a virtual directory. Name the virtual directory Test1, and then click the folder that is named C:\Projects\Test1.
  5. Open an existing ASP.NET Web application in Visual Studio .NET. From the Build menu, click Build Solution.
  6. From the dropdown list in the toolbar, change the compile mode from Debug to Release.
  7. Select the Project, and then click Copy Project.
    1. For the Destination project folder, type: http://servername/test1, where servername is the name of your server, Test1 is the virtual directory and is also the name of the folder that you created in steps 3 and 4 of this section of the article.
    2. For the Web access method, select File Share. For the Path, type \\Servername\Projects\Test1.
    3. Select the Copy option for your project.
NOTE: This sample describes how you copy the project to a folder that you created from the root of drive C. You can also follow the same steps to copy the project to the Web root (\\InetPub\Wwwroot).

↑ Back to the top


References

For more information about the Visual Studio .NET Copy Project dialog box, visit the following Microsoft Developer Network Web site: For more information about FrontPage Server Extensions (FPSE), visit the following Microsoft Developer Network Web site:
Microsoft FrontPage Server Extensions 2002 for Windows
http://msdn2.microsoft.com/en-us/library/aa140175(office.10).aspx

↑ Back to the top


Keywords: KB326356, kbhowtomaster, kbdeployment

↑ Back to the top

Article Info
Article ID : 326356
Revision : 10
Created on : 2/12/2007
Published on : 2/12/2007
Exists online : False
Views : 430