翻訳への提案を行います
 
他のユーザーによる提案:

progress indicator
他の提案はありません。
 印刷用ページ       送信     
クリックして評価とフィードバックをお寄せください
MSDN
MSDN ライブラリ
すべて縮小/すべて展開 すべて縮小
コンテンツの表示:   英語と日本語を並べて表示コンテンツの表示: 英語と日本語を並べて表示
このページは、ベータ版用に機械翻訳されたものです。翻訳者による翻訳は、製品の正規版で提供される予定です。詳細についてはよくある質問 を参照してください。またぜひこちら からアンケートにもご協力ください。
Walkthrough: Creating a Basic Web Package

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

A Web package is a collection of files, settings, databases, and auxiliary information that creates a Web application. These items can be contained in a folder structure or in a compressed (.zip) file for deployment or installation onto a server. You can use Microsoft Visual Studio 2010 to create a Web package that can be deployed onto a Web server using the Microsoft Web Deployment Tool (MsDeploy.exe).

In summary, the tasks that you follow in order to create and deploy a Web package are the following:

  • In an ASP.NET Web application project, you create a configuration that defines the contents and other attributes of the package.

  • You create the package, which produces a file (for example, a compressed file) that you can copy to a destination server.

  • On the destination server, you create an IIS application.

  • You run the Web Deployment Tool (MSDeploy.exe) with the deployment package, which installs the application files and configures IIS.

Each of these steps is illustrated in this walkthrough.

In order to run this walkthrough, you will need the following:

  • Microsoft Visual Studio 2010.

Some of the functionality in Web packaging might not work correctly for Web application projects and Web site projects created by using earlier versions of Visual Studio.

You can package an existing Web application or create a new one to package. If you use a project that was created with a version of Visual Studio earlier than Microsoft Visual Studio 2010, you will be prompted to upgrade the project to a Visual Studio 2010 project when you open the project. In that case, you should make a copy of the existing project, and then open the project in Visual Studio 2010. You will then be prompted to convert the project to a Visual Studio 2010 project.

To create a new Web application project to package

  1. Select Project from the File menu.

    The New Project dialog box is displayed.

  2. Select Web Node, and then select ASP.NET Web Application Project.

    Visual Studio creates a new Web application that can be packaged without modification.

You specify options for a Web package by creating a package configuration setting. The configuration setting specifies what environment the Web package will be deployed in, and determines what files should be included in the package. For example, you might create a Web package for deployment on a test server that uses the Debug configuration setting. This setting might specify that the package includes program database (.pdb) files to enable debugging in the deployed application. You might also create a Web package for a production release, in which the package excludes the .pdb files.

By default, there are configuration settings for Release and Debug. For this walkthrough, you will create a new configuration setting for a staging server.

To create a new staging configuration setting

  1. From the Build menu, select Configuration Manager.

    The Configuration Manager dialog box is displayed.

  2. From the Active solution configuration list, select <New…>.

    The New Solution Configuration dialog box appears.

  3. In the Name field, enter Staging , select Release from the Copy settings from list, and then select ASP.NET Web Application Project.

  4. Click Ok.

  5. Close the Configuration Manager dialog box.

After you create a new configuration setting, that configuration setting is listed as the active configuration setting on the Publish tab of the Properties page.

After you have created a configuration setting, you can then set the properties for the Web package that is specified by those configuration settings. Property settings are stored with each configuration setting. By default, you have the option of creating property settings for Debug, Release, and All Configurations.

For an explanation of the property settings on the Publish tab, see the overview topic Deploying Web Packages Overview.

To set the properties for a Web package

  1. In Solution Explorer, double-click Properties.

    The Property page appears.

  2. Click the Package/Publish tab to access deployment settings.

  3. Select Staging from the Configuration list.

  4. From the Items to Package or Publish. list, select Only files needed to run this application

  5. Under MSDeploy Package Settings, select Create MSDeploy package as a ZIP file.

    The Package Location text box indicates where the package is created. By default, the file is created in a folder in the obj/Debug directory.

  6. From the File menu, select Save Selected Items to save the property settings that you have selected.

Once you have set the properties for the Web package, you can create the package several ways.

  • From the Project menu, select Package and then select Create Package.

  • Right click the project name in Solution Explorer, select Package and then select Create Package.

When you use either of these options to create a Web package, the Output window shows the package creation and any errors. By default, the package is created in a folder in the obj directory.

To view a Web package

  1. In Solution Explorer, open the obj folder. If no obj folder appears in the Solution Explorer window, click the Show All Files button at the top of the Solution Explorer window.

  2. Open the Debug folder, and then open the Package folder.

    Notice that the name of the Web package is the same as the Web application, but with the .zip extension.

So far in this walkthrough, you have created a Web package that consists of a .zip file and support files. To deploy the package, you must copy three files to the destination server:

  • projectname.deploy.cmd

  • projectname.SetParameters.xml

  • projectname.zip

When you copy the files to a destination server, notice the physical location of the files. You need this information when you create and install an IIS application.

The latest version of the Web Deployment Tool (MSDeploy.exe) is included with Visual Studio and is automatically installed as part of the Visual Studio installation. The destination server must also have a copy of MSDeploy.exe. If you do not have Visual Studio installed on the destination server, you can download a free copy of the tool from the Web Deployment Tool download page on the IIS Web site.

Creating an IIS Application

If you are using IIS, you must create an IIS application on the target server that points to the Web package that you are deploying on the server. You can use the IIS Management Console to create this application.

To create an IIS application

  1. On the destination server, from the Start menu, select Run.

  2. Type inetmgr in the text box.

  3. In the Internet Information Services (IIS) Manager window, open the Web Sites folder, and then right-click the Default Web Site icon.

  4. Select Add Application.

  5. In the Add Application dialog box, type the name of the application in the Alias text box.

  6. In the Physical path text box, type the directory where the Web package files are located on the destination server.

  7. Click Ok.

To deploy the Web package onto a destination server, you must modify the projectname.SetParameters.xml file and then run MSDeploy.exe to unpack the files that were part of the compressed .zip file.

Modifying the SetParameters file

The projectname.SetParameters.xml file contains the location where the Web package should be unpacked and the Web application deployed. If you copied the Web package from a development computer to a destination server, you must modify the manifest file to reflect the physical location where the Web application should be deployed.

For example, after you created the Web package on the development computer, the contents of the projectname.DestManifest.xml file will resemble the following XML:

<sitemanifest>
  <contentPath path="D:\Documents and Settings\username\My Documents\Visual Studio 10\Projects\WebApplication1_deploy" />
</sitemanifest>

Before you run MSDeploy, you must change the path attribute to the physical path of the directory you want the Web application deployed to.

Running the Microsoft Web Deployment Tool (MSDeploy.exe) to Install the Web Application

The Microsoft Web Deployment Tool (MSDeploy.exe) is a command line utility that you use to install a Web package. It uses the projectname.deploy.cmd file to determine the location and structure of the Web application to be deployed.

The following table lists switches that you can use with MSDeploy.exe.

Switch

Use

/t

Indicates trial mode, where MSDeploy does not deploy the Web package, but shows what would occur if you had installed the package.

/y

Indicates yes mode, where MSDeploy installs the Web package to the specified location.

To install the Web package using the Microsoft Web Deployment Tool

  1. On the destination server, from the Start menu, select Run.

  2. Type cmd in the text box.

  3. In the Command Prompt window, locate the directory that contains the MSDeploy.exe application. If you chose the default location when you installed MSDeploy, the tools is in the following folder

    C:\Program Files\IIS\Microsoft Web Deploy

  4. To test the installation, type the full path name and file name of the .cmd file of the Web package and then add the /t switch, as in the following example:

    D:\Users\ username \Desktop\WebApplication3.deploy.cmd /t

    The output shows the commands executed from the command file and any resulting action.

  5. If you want to install the application, type the full path name and file name of the .cmd file of the Web package and then add the /y switch, as in the following example:

    D:\Users\ username \Desktop\WebApplication3.deploy.cmd /y

    The application is installed.

This walkthrough has given you an overview of how to create and deploy a Web package. The actual process that you use to deploy production applications will vary, depending on the source project, on the purpose is for the deployment, of how much access you have to the destination server, and so on.

For more information about working with Web packages, see the following topics:

Other Resources

Deploying Web Packages Overview
チュートリアル: 基本 Web パッケージの作成

[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。]

Web パッケージには、ファイル、設定、データベース、および Web アプリケーションを作成する補足情報の集まりです。 これらのアイテムまたは展開のサーバーにインストール圧縮 (.zip) ファイルのフォルダー構造で格納できます。 Microsoft Visual Studio 2010 を使用して、Microsoft Web デプロイメント ツール (MsDeploy.exe) を使用して Web サーバー上に配置できる Web パッケージを作成することができます。

要約すると、タスクの作成し、Web パッケージを展開するために実行するには、次です。

  • ASP.NET Web アプリケーション プロジェクトで、内容と、パッケージの他の属性を定義する構成を作成します。

  • 配布先サーバーにコピーできますファイル (たとえば、圧縮ファイル) を生成するパッケージを作成します。

  • 転送先サーバー上で IIS アプリケーションを作成します。

  • アプリケーション ファイルをインストールし、IIS を構成、展開パッケージには、Web デプロイメント ツール (MSDeploy.exe) を実行します。

このチュートリアルでそれぞれの手順を示します。

するこのチュートリアルを実行して、が必要。

  • Microsoft Visual Studio 2010.

Web パッケージの機能の一部可能性がありますいない正しく Web アプリケーション プロジェクトと Visual Studio の以前のバージョンを使用して作成されたサイトのプロジェクトの Web。

既存の Web アプリケーションをパッケージ化したり、新しい GPO をパッケージを作成できます。 Visual Studio Microsoft Visual Studio 2010より前のバージョンで作成されているプロジェクトを使用している場合、プロジェクトを開くと、 Visual Studio 2010 プロジェクトにプロジェクトをアップグレードするように求められます。 その場合は、既存のプロジェクトのコピーを作成し、Visual Studio 2010 にし、プロジェクトを開く必要があります。 求められますVisual Studio 2010 プロジェクトにプロジェクトを変換します。

パッケージに新しい Web アプリケーション プロジェクトを作成

  1. プロジェクト ファイル メニューの [の [します。

    [新しいプロジェクト] ダイアログ ボックスが表示されます。

  2. を Web ノードを選択し、ASP.NET Web アプリケーション プロジェクト します。

    Visual Studio は変更せずにパッケージ化できる新しい Web アプリケーションを作成します。

Web パッケージ オプションを指定するにはパッケージの構成設定を作成します。 設定は、パッケージどのような環境の Web パッケージで展開され、ファイルの内容を決定する必要があります含めるを指定します。 たとえば、デバッグ 構成設定を使用するテスト サーバーで展開用に Web パッケージを作成します。 この設定が、パッケージに配置されたアプリケーションでデバッグを有効にするプログラム データベース (.pdb) のファイルが含まれる指定します。 パッケージが.pdb ファイルを除外する生産リリースでパッケージを作成する可能性があります。

既定では、 のリリースの構成設定がされ をデバッグします。 このチュートリアルでは、ステージング サーバーの新しい構成設定は作成します。

新しいステージング構成設定を作成するには

  1. メニューの [を作成、構成マネージャー を選択します。

    [構成マネージャー] ダイアログ ボックスが表示されます。

  2. アクティブ ソリューション構成の 一覧から <新規作成 > を選択します。

    [新しいソリューション構成] ダイアログ ボックスが表示されます。

  3. フィールドで、ステージングの を入力して、[リリースの の一覧からコピー設定から選択し、[ASP.NET Web アプリケーション プロジェクト します。

  4. の OK をクリックします。

  5. [構成マネージャー] ダイアログ ボックスを閉じます。

後に新しい構成設定、構成設定が、作業中の構成のプロパティ] ページの タブ設定として表示されていることを作成します。

構成の設定、作成した後、これらの設定で指定した Web パッケージのプロパティを設定できます。 プロパティの設定は各構成設定で保存されます。 既定では、デバッグの リリースをすべての構成の プロパティ設定の作成のオプションがあります。

タブ プロパティ設定の詳細について、概要トピック Deploying Web Packages Overview を参照してください。

Web パッケージのプロパティを設定するには

  1. プロパティ のソリューション エクスプローラー、ダブルクリックします。

    プロパティ ページが表示されます。

  2. パッケージ/発行 タブの展開設定にアクセスするをクリックします。

  3. 構成 一覧からステージング を選択します。

  4. パッケージまたは を発行する項目。 このアプリケーション の実行に必要な選択 のみのファイルの一覧

  5. の MSDeploy パッケージの設定を MSDeploy の作成のパッケージ、ZIP ファイル としてします。

    パッケージの場所 テキスト ボックスは、パッケージが作成された場所を示します。 既定は、ファイルが obj/デバッグ ディレクトリにフォルダーに作成されます。

  6. 選択したプロパティ設定を保存選択したアイテムの保存 選択します。

Web パッケージのプロパティを設定したら後、は、パッケージのいくつかの方法を作成できます。

  • プロジェクト メニュー のパッケージを選択し、パッケージ作成 します。

  • ソリューション エクスプローラーでプロジェクト名を右クリックして、パッケージの を選択し、 のパッケージの作成] をクリックします。

これらのオプションのいずれかを Web パッケージを作成するのには使用するとが 出力 ウィンドウに、パッケージの作成と、エラー表示されます。 既定は、パッケージが obj ディレクトリのフォルダーに作成されます。

Web パッケージを表示するには

  1. のソリューション エクスプローラー] で obj フォルダーを開きます。 ソリューション エクスプローラー ウィンドウで obj フォルダーが表示されない場合は、[ソリューション エクスプローラー ウィンドウの上部にある、 のすべてのファイルを表示する をクリックします。

  2. デバッグ フォルダー] を開き、パッケージ フォルダーを開きます。

    することを確認、Web パッケージの名前、同じ Web アプリケーションが、.zip 拡張子を持つします。

これまでこのチュートリアルでを作成した.zip ファイルから成る Web パッケージ ファイルをサポートします。 パッケージを展開するには 3 つのファイルを宛先サーバーにコピーする必要があります。

  • projectname deploy.cmd。

  • projectname SetParameters.xml。

  • projectname.zip

転送先サーバーにファイルをコピーするが、ファイルの物理的な場所を表示します。 この情報を作成し、IIS アプリケーションをインストールすると必要です。

Web デプロイメント ツール (MSDeploy.exe) の最新バージョン Visual Studio に含まれているし、 Visual Studio インストールの一部として自動的にインストールがします。 転送先サーバー MSDeploy.exe のコピーも必要です。 Visual Studio 先サーバーにインストールされてない場合は IIS Web サイトでダウンロード ページ Web デプロイメント ツールの から無料ツールのコピーをダウンロードできます。

IIS アプリケーションの作成

IIS を使用している場合は、サーバー上で展開する Web パッケージを指す対象サーバーで IIS アプリケーションを作成する必要があります。 IIS 管理コンソールを使用してこのアプリケーションを作成することができます。

IIS アプリケーションを作成するには

  1. 転送先サーバー上の スタート] から 実行選択します。

  2. [テキスト] ボックスに inetmgr の を入力します。

  3. インターネット インフォメーション サービス (IIS) マネージャー ウィンドウには、 Web サイトの フォルダーを開き 既定の Web サイト アイコンを右クリックします。

  4. 選択 アプリケーション を追加します。

  5. アプリケーションの追加 ] ダイアログ ボックスに、 エイリアス テキスト ボックスに、アプリケーションの名前を入力します。

  6. 物理パス テキスト] ボックスに、転送先サーバーで Web パッケージ ファイルがどこにあるディレクトリを入力します。

  7. の OK をクリックします。

Web パッケージ配布先サーバー上に展開するには、変更する必要があります projectname。 SetParameters.xml ファイルと、圧縮された .zip ファイルの一部だったファイルをアンパックするには MSDeploy.exe を実行します。

SetParameters ファイルの変更

projectname。 SetParameters.xml ファイルには、Web パッケージを展開したはずの場所と、Web アプリケーションの展開が含まれています。 開発用コンピューターから、転送先サーバーに Web パッケージをコピーする場合、Web アプリケーションを展開する必要があります、物理的な場所を反映するマニフェスト ファイル変更する必要があります。

たとえば、後にパッケージに作成した Web の projectname の内容、開発コンピューター上。 DestManifest.xml ファイルでは、次の XML はようになります。

<sitemanifest>
  <contentPath path="D:\Documents and Settings\username\My Documents\Visual Studio 10\Projects\WebApplication1_deploy" />
</sitemanifest>

MSDeploy を実行する前に、Web アプリケーションに展開するディレクトリの物理パスに path 属性を変更します。

マイクロソフトの Web 配置ツール、Web アプリケーションをインストールするには、(MSDeploy.exe) を実行

マイクロソフトの Web デプロイメント ツール (MSDeploy.exe) は、コマンド ライン ユーティリティを使用して、Web パッケージをインストールします。 projectname を使用しています。 deploy.cmd ファイルの場所および展開するには、Web アプリケーションの構造を決定します。

次の表の MSDeploy.exe で使用できるスイッチです。

Switch

使用方法

/t

MSDeploy は、Web パッケージを配置しない、試用版のモードがパッケージをインストールしていた場合に発生とする番組を示します。

/y

[はい] モード、MSDeploy が、指定した場所に Web パッケージをインストール場所を示します。

Microsoft Web 配置ツールを使って Web パッケージのインストール

  1. 転送先サーバー上の スタート] から 実行選択します。

  2. [テキスト] ボックスに cmd の を入力します。

  3. コマンド プロンプトの ウィンドウで、MSDeploy.exe アプリケーションを含むディレクトリを探します。 MSDeploy をインストールしたときに、既定の場所を選択した場合、ツールは、次のフォルダー

    C:\Program Files\IIS\Microsoft Web Deploy

  4. インストールをテストするには、Web パッケージの.cmd ファイルのファイルの名前と完全なパス名を入力して、次例のように、/t スイッチを追加します。

    D:\Users\ username \Desktop\WebApplication3.deploy.cmd /t

    コマンド ファイル生成される操作からを実行するコマンドが、出力表示されます。

  5. アプリケーションをインストールする場合は、Web パッケージの.cmd ファイルのファイルの名前と完全なパス名を入力して、次例のように、/y スイッチを追加します。

    D:\Users\ username \Desktop\WebApplication3.deploy.cmd /y

    アプリケーションがインストールされています。

このチュートリアルで与えを作成して、Web パッケージを展開する方法の概要。 アプリケーションは異なる生産を展開するために使用実際のプロセス、量が、宛先サーバーへというへのアクセスの展開では目的に、ソース プロジェクトに依存します。

を Web パッケージを使用する方法については、次トピックを参照してください。

その他の技術情報

Deploying Web Packages Overview
© 2009 Microsoft Corporation. All rights reserved. 使用条件 | 商標 | プライバシー
Page view tracker