다음을 통해 공유


Deploying Local Application Components

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

ASP.NET application components are all of the DLL files that the application uses to perform a variety of tasks. They can include business logic and database access logic for three-tier applications, as well as custom ASP.NET server controls that you have developed. To work for an application, each of the DLLs associated with these components must be deployed to your application's \Bin directory.

Procedures

To deploy ASP.NET application components 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 compiled component files that you want to deploy, including the drive and directory 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 files should be placed.

The following example command copies all compiled components from the C:\devApp\bin directory to the D:\liveApp\bin directory.

xcopy c:\devApp\bin d:\liveApp\bin

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

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\

To compile and deploy an assembly to an application's \Bin directory 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. Use the cd command to navigate to the directory that you want. This command uses relative paths to navigate through the directories and drives on a computer or network.

    The root location of any path that this command uses is the local drive, often C:\. The examples shown in this procedure assume that you have navigated to the directory where the source files are located. The following use of the cd command moves the command prompt from a directory two directories beneath the local drive root to a myApp directory directly beneath the root.

    cd..\..\myApp

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

    csc /t:library /out: <destination path> <source path>

    vbc /t:library /out: <destination path> <source path>

Note

In this command, <destination path> is a placeholder that represents the path to the .dll file that is compiled by this command, and <source path> represents the path to the source file. Each <destination path> should include \Bin and the full name you assign to the .dll file. Both <destination path> and <source path> are relative paths.

The following example compiles HelloObj.dll from the command line from a HelloObj.cs or HelloObj.vb source file. The destination path is a relative path from the directory where the command line currently is to the \Bin directory of the ASP.NET application where the .dll is used. The source file is in the same directory as the command line.

csc /t:library /out:..\..\..\..\bin\HelloObj.dll HelloObj.cs

vbc /t:library /out:..\..\..\..\bin\HelloObjVB.dll HelloObj.vb