1

タイトルには拡張が必要です。要約すると、次のことは不可能だと思います。

  • Web サイトを IIS 8 ホストに展開する
  • Web 配置パッケージの使用
  • VS 2013 ですぐに使える公開機能を使用する
  • 特定のサイトに展開する権限が委任されている管理者以外の IIS マネージャー ユーザーを使用する

それはすべて、すべてを台無しにする1つの小さな詳細に帰着するように見えますが、すべてがバラバラになるまでのプロセスを説明する必要があります.

PublishWeb パッケージに発行するように構成された VS 2013 で発行プロファイルを作成します。次に、開発者コマンド プロンプトで次のコマンドを実行します。

msbuild Solution.sln /t:Build /p:DeployOnBuild=true;PublishProfile=Publish;IsDesktopBuild=false

これはビルド プロセスを経て、_PublishedWebsites\Web_Packageフォルダー内に予想されるパッケージと展開ファイルが表示されます。次のステップは、Web_Package フォルダーからこれを実行することです。

Web.deploy.cmd /Y /M:https://example.blah:8172/MsDeploy.axd /U:user /P:p@44w0rd /A:Basic

ここで問題が発生します。これにより、次の拡張コマンドが生成されます (読みやすいように書式設定されています)。

msdeploy.exe
    -source:package='.\Web.zip'
    -dest:auto,computerName="https://example.blah:8172/MsDeploy.axd",userName="user",password="p@44w0rd",authtype="Basic",includeAcls="False"
    -verb:sync 
    -disableLink:AppPoolExtension 
    -disableLink:ContentExtension 
    -disableLink:CertificateExtension 
    -setParamFile:".\Web.SetParameters.xml"

その実行結果は次のとおりです。

Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("example.blah") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.

次のように、展開されたコマンドだけを手動で再実行し、siteパラメータに MsDeploy.axd URL のタグを付けることで、この問題を解決できます。

msdeploy.exe
    -source:package='.\Web.zip'
    -dest:auto,computerName="https://example.blah:8172/MsDeploy.axd?site=example.blah",userName="user",password="p@44w0rd",authtype="Basic",includeAcls="False"
    -verb:sync 
    -disableLink:AppPoolExtension 
    -disableLink:ContentExtension 
    -disableLink:CertificateExtension 
    -setParamFile:".\Web.SetParameters.xml"

ただし、MSBuild によって自動生成された Web.deploy.cmd を介してこれを設定する方法がわかりません。私がこれを試してみると:

Web.deploy.cmd /Y /M:https://example.blah:8172/MsDeploy.axd?site=example.blah /U:user /P:p@44w0rd /A:Basic

結果は次のようになります (ここでも、読みやすいように書式設定されています)。

msdeploy.exe
    -source:package='D:\DEV\Solution\Web\bin\_PublishedWebsites\Web_Package\Web.zip'
    -dest:auto,computerName="https://example.blah:8172/MsDeploy.axd?site",userName="user",password="p@44w0rd",authtype="Basic",includeAcls="False"
    -verb:sync 
    -disableLink:AppPoolExtension 
    -disableLink:ContentExtension 
    -disableLink:CertificateExtension 
    -setParamFile:"D:\DEV\Solution\Web\bin\_PublishedWebsites\Web_Package\Web.SetParameters.xml"  example.blah
Error: Unrecognized argument 'example.blah'. All arguments must begin with "-".
Error count: 1.

管理者アカウントを使用して、このプロセスを正常に実行できます。しかし、非管理者にはこの site= querystring 値が必要であり、自動生成された Web.deploy.cmd にはそれがないようです。

ここで明らかな何かが欠けていますか?IIS 管理側で不足しているアクセス許可はありますか? このブログ投稿で指示されているように、管理サービスの委任ルールが設定されていることを確認しました。

4

2 に答える 2

0

次のように /M: パラメータを引用符で囲むことができます。

Web.deploy.cmd /Y "/M:https://example.blah:8172/MsDeploy.axd?site=example.blah" /U:user /P:p@44w0rd /A:Basic
于 2015-05-14T22:52:39.207 に答える
0

私がレイアウトしたプロセスを使用して、これを回避する方法がわかりません。ここでの私の解決策は、展開された MSDeploy.exe コマンド ラインを取得し、生成された*.deploy.cmdファイルの代わりに直接使用することです。

もちろん、誰かが私の元の問題に対する実際の解決策を見つけた場合は、喜んでその解決策を回答としてマークします。それまでは、これが私の解決策です。

于 2015-01-26T00:00:30.020 に答える