7

/p:DeployOnBuild=Trueパラメータが渡されたときに MSBuild によって生成される ProjectName.deply.cmd を実行しようとしています。引数「ComputerName」の 1 つが として渡されhttps://WebServer01:8172/MSDeploy.axd?SiteName=MySiteNameます。私のコマンドラインは

ProjectName.deploy.cmd /Y /M:https://WebServer01:8172/MSDeploy.axd?Site=MySiteName 
                       -AllowUntrusted /U:DeployUserName /P:Password /A:Basic

戻る

Error: Unrecognized argument 'MySiteName'. All arguments must begin with "-".

実際に実行されるコマンドは

"C:\Program Files\IIS\Microsoft Web Deploy V3\\msdeploy.exe" 
    -source:package='Y:\ProjectName.zip'
    -dest:auto,computerName='https://WebServer01:8172/MSDeploy.axd?Site',userName='DeployUserName',password='Password',authtype='Basic',includeAcls='False'
    -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension 
    -disableLink:CertificateExtension 
    -setParamFile:"Y:\ProjectName.SetParameters.xml"
    MySiteName
    -AllowUntrusted

/M への引数https://WebServer01:8172/MSDeploy.axd?Site=MySiteNameが 2 つの引数に分割されていることに注意してください。したがって、computerName='https://WebServer01:8172/MSDeploy.axd?Site'and および 追加の引数が作成されますMySiteName

Visual Studio 2010 Service Pack 1 では、引用符で囲まれたパラメーターを使用して展開パッケージを実行すると失敗しますが、引数のみArgMsDeployAdditionalFlagsを処理し、引数は処理しません/M:ComputerName

SiteName が渡されない場合、サーバー上で管理者権限を持つユーザーでデプロイを正常に実行できますが、標準の IIS ユーザー DeployUserName を使用すると 401 が発生します。

ProjectName.deploy.cmd /Y /M:https://WebServer01:8172/MSDeploy.axd
                       -AllowUntrusted /U:DeployUserName /P:Password /A:Basic

サーバーは 401 を返します

Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("WebServer01") 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.

Error: The remote server returned an error: (401) Unauthorized.

そのユーザーの権限は、そのユーザーを使用VS2012したMSDeployプロファイルからの発行が正常に機能するため、問題ありません。msdeploy.exeコマンドをビルドすることもでき、それも正常に動作します。fromProjectName.deploy.cmdの一部として生成されているため、 を使用する必要があります。Team BuildTFS2010

4

2 に答える 2

9

引数を引用しようとしましたか?

ProjectName.deploy.cmd /Y "/M:https://WebServer01:8172/MSDeploy.axd?Site=MySiteName" 
                   -AllowUntrusted /U:DeployUserName /P:Password /A:Basic
于 2012-10-04T11:43:11.370 に答える