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.
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:
Right-click Solution in Solution Explorer, and then point to Properties.
Click the Configuration Properties folder in the left pane.
Click the name of the project in the right pane, and then click Release on the Configuration dropdown menu.
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.
From the Project menu, click Copy Project.
From the Copy Project dialog box, point to the Destination project folder that you want to use.
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.
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.
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
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:
Open Internet Services Manager. Or, if you run Microsoft Windows XP on your computer, open Internet Information Services.
In the left pane, right-click the name of your virtual directory, and then click Properties.
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:
Follow these steps to perform a Copy Project to a remote Web server:
On the remote server, create a folder for all your Visual Studio .NET projects, for example: C:\Projects.
Turn on file sharing for the C:\Projects directory.
Create a subfolder in the C:\Projects directory with the name of the project that you want to copy, for example: c:\Projects\Test1.
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.
Open an existing ASP.NET Web application in Visual Studio .NET. From the Build menu, click Build Solution.
From the dropdown list in the toolbar, change the compile mode from Debug to Release.
Select the Project, and then click Copy Project.
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.
For the Web access method, select File Share. For the Path, type \\Servername\Projects\Test1.
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).
For more information about the Visual Studio .NET Copy Project dialog box, visit the following Microsoft Developer Network Web site: