gpt4 book ai didi

deployment - 如何在 ProjectName.deploy.cmd 中传递站点名称

转载 作者:行者123 更新时间:2023-12-04 14:15:49 29 4
gpt4 key购买 nike

我正在尝试运行由 MSBuild 生成的 ProjectName.deply.cmd 当参数 /p:DeployOnBuild=True通过。参数“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'和和额外的参数 MySiteName .

我经历过 Running a deployment package with quoted parameters fails in 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 的一部分生产的来自 TFS2010 .

最佳答案

你有没有试过引用这个论点?

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

关于deployment - 如何在 ProjectName.deploy.cmd 中传递站点名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12721896/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com