Microsoft KB Archive/326356

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

Article ID: 326356

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft ASP.NET 1.0
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Internet Information Server 4.0
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer

-



This article was previously published under Q326356



IN THIS TASK
SUMMARY
 * Set the Project to Release Mode Before You Perform the Copy Project
 * Steps to Perform Copy Project in Visual Studio .NET
 * Web Server Setup Requirements
 * Copy a Project to a Remote Server

REFERENCES



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.

back to the top

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.

back to the top

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.

-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.  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.</li> Select the All project files option if you must include all build files, the project file, and the source files.</li> Select the All files in the source project folder option if you must copy all the files from the source folder.</li></ul>

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.</li></ol>

back to the top

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: <ol> Open Internet Services Manager. Or, if you run Microsoft Windows XP on your computer, open Internet Information Services.</li> In the left pane, right-click the name of your virtual directory, and then click Properties.</li> 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://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/sharepnt/proddocs/admindoc/owsd02.asp

</li></ol>

back to the top

Copy a Project to a Remote Server
Follow these steps to perform a Copy Project to a remote Web server: <ol> On the remote server, create a folder for all your Visual Studio .NET projects, for example: C:\Projects .</li> Turn on file sharing for the C:\Projects directory.</li> Create a subfolder in the C:\Projects directory with the name of the project that you want to copy, for example: c:\Projects\Test1 .</li> 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.</li> Open an existing ASP.NET Web application in Visual Studio .NET. From the Build menu, click Build Solution.</li> From the dropdown list in the toolbar, change the compile mode from Debug to Release.</li> Select the Project, and then click Copy Project. <ol style="list-style-type: lower-alpha;"> For the Destination project folder, type: http:// /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.</li> <li>For the Web access method, select File Share. For the Path, type \\Servername\Projects\Test1 .</li> <li>Select the Copy option for your project.</li></ol> </li></ol>

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

<div class="references_section">