我在IIS网站下有一个子应用程序,我可以使用Visual Studio中的发布向导来部署它。
然而,我从我们的构建服务器自动部署,所以我更喜欢直接使用msdeploy.exe。
我可以部署主网站,但尝试部署子应用程序拒绝工作。
这是可行的(www.mymainwebsite.co.uk是IIS网站):
-setParamFile:"www.mymainwebsite.co.uk\obj\Test\Package\www.mymainwebsite.co.uk.SetParameters.xml“
msdeploy.exe msdeploy.exe -dest:auto,computerName='https://testweb1:8172/MsDeploy.axd?site=www.mymainwebsite.co.uk',userName='xxx',password='xxx',authtype='Basic',includeAcls='False‘-verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -disableLink:CertificateExtension -allowUntrustedInfo
这不是(SubApplication是应用程序路径):
-setParamFile:"SubApplication\obj\Test\Package\SubApplication.SetParameters.xml“
msdeploy.exe msdeploy.exe -dest:auto,computerName='https://testweb1:8172/MsDeploy.axd?site=www.mymainwebsite.co.uk/',userName='xxx',password='xxx',authtype='Basic',includeAcls='False‘-verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -disableLink:CertificateExtension -allowUntrustedInfo
错误是:
Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("testweb1") 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.
正如我所说的,这在Visual Studio发布向导中工作,将Site/application属性设置为www.mymainwebsite.co.uk/SubApplication,因此我知道这不是服务器上的权限问题。
我是不是在msdeploy参数中遗漏了什么?
发布于 2012-09-10 20:52:05
我在命令行中使用以下命令来设置web应用程序:
-setParam:name="IIS Web Application Name",value="www.mymainwebsite.co.uk/SubApplication"
发布于 2018-06-09 05:16:39
要将web部署到主站点的子应用程序,请转到TFS,Deploy IIS App步骤,将覆盖参数更新为如下所示
name="IIS Web应用程序名称“,value=”主站点/子应用程序“
它应该会成功的!!
https://stackoverflow.com/questions/12301578
复制相似问题