Partager via


Deploying ASP.NET Application Files and Local Components

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

To deploy an ASP.NET application, simply copy the application files you have created from your development computer to the production Web server that will host your application. You can use the XCOPY command-line tool or any FTP application to copy the files from one location to another.

To deploy assemblies that you want to share across Web applications, such as assemblies that contain custom ASP.NET server controls, you must deploy them to the global assembly cache. For more information, see the "Global Assembly Cache" topic in .NET Framework Help.

Procedures

To deploy ASP.NET application files from the command line

  1. From the Start menu, click Run.

  2. In the Open box in the Run dialog box, type cmd, and then click OK.

  3. At the command prompt, type the following command:

    xcopy <source path> <destination path>

Note

In this command, <source path> is a placeholder that represents the full path to the source files you want to copy, including the drive, the directory, and the file names. You can omit the file names if you want all files in the directory to be copied. The <destination path> placeholder represents the full path to the directory where the copied files should be placed.

The following example command copies all files from the C:\myWebApp directory to the D:\liveApp directory.

xcopy c:\myWebApp d:\liveApp

  1. Answer any questions about the files or directory you are copying.

You can use this procedure when you want to update a DLL stored in your application's \Bin directory, or if you want to update any of your other application files. The following example copies a single DLL from a \Bin directory on one drive to a \Bin directory on another.

xcopy c:\devApp\bin\myAssembly.dll d:\liveApp\bin\

You can also use this command to update files in your application once you have deployed it. Although you can copy an entire directory at once, individual files must be copied one at a time. You can exclude subdirectories, files with a specific file name extension, or specific file names from being copied by using the XCOPY /exclude option. For more information about how to use the XCOPY tool, open Help for your operating system and search for XCOPY.

Note

You must use physical directory names with the XCOPY tool. You cannot use virtual directory names.