8

Visual Studio 2010 でパッケージ化された Web サイトを展開するためのバッチ スクリプトを作成しています。スクリプトでは、新しいサイトを次のように追加しています。

appcmd add site /name:MySite /id:123

ただし、サイト ID を指定したくありません。appcmdランダムに1つを割り当てたいだけです。しかし、idパラメータは に必要なappcmdので、どうすればそれを回避できますか?

4

2 に答える 2

11

/id パラメータが必要だとは知りませんでした - 私は常に次の形式を使用してきました:

appcmd add site /name:"%appName%" /bindings:http://%appDns%:80 /physicalPath:"%mainApplicationPath%"

そして、何の問題もありませんでした。appcmd を指定しないと、どのようなエラーが表示されますか?

于 2012-04-27T22:30:49.507 に答える
2

appcmd ヘルプを使用して、次のように入力します

%systemroot%\system32\inetsrv\APPCMD add site /?

そして、name パラメータのみが必要であることがわかります。これがその出力の一部です。

[w:\kanta]%systemroot%\system32\inetsrv\APPCMD add site /? 新しい仮想サイトを追加

APPCMD add SITE <-parameter1:value1 ...>

指定された設定で新しい仮想サイトを作成します。少なくとも、サイト名と ID を指定する必要があります。

サポートされているパラメーター:

/名前 (必須)

Site name

/id

Site id

/バインディング

List of bindings in the friendly form of "http://domain:port,..." or raw
form of "protocol/bindingInformation,..."

/物理パス

If specified, will cause the root application containing a root virtual
directory pointing to the specified path to be created for this site.  If
omitted, the site is created without a root application and will not be
startable until one is created.

/?

Display the dynamic site properties that can be set on the new site
于 2012-04-27T22:39:14.857 に答える