我正在尝试运行参数/p:DeployOnBuild=True
传递时由 MSBuild 生成的 ProjectName.deply.cmd。参数“ComputerName”之一将作为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
分为两个参数,因此创建了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
命令,并且运行良好。我必须使用ProjectName.deploy.cmd
它作为Team Build
from的一部分生产的TFS2010
。