如何使用MsDeploy在网站中部署子应用程序

时间:2012-09-06 13:48:19

标签: visual-studio deployment iis-7 msdeploy webdeploy

我在IIS网站下面有一个子应用程序,我可以使用Visual Studio中的发布向导来部署它没问题。

但是,我正在从构建服务器自动部署,所以我更喜欢直接使用msdeploy.exe。

我可以部署主网站,但尝试部署子应用程序拒绝工作。

这是有效的(www.mymainwebsite.co.uk是IIS网站):

  

msdeploy.exe   -source:包= 'www.mymainwebsite.co.uk \ OBJ \测试\包\ www.mymainwebsite.co.uk.zip'   -dest:汽车,计算机名= 'https://开头testweb1:8172 / MsDeploy.axd网站= www.mymainwebsite.co.uk',用户名= 'XXX',密码= 'XXX',的authType = '基本',includeAcls = 'FALSE'   -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:“www.mymainwebsite.co.uk \ _obj \ Test \ Package \ www.mymainwebsite.co.uk.SetParameters.xml”   -allowUntrustedInfo

这不是(SubApplication是应用程序路径):

  

msdeploy.exe   -source:包= '子程序\ OBJ \测试\包\ SubApplication.zip'   -dest:汽车,计算机名= 'https://开头testweb1:8172 / MsDeploy.axd站点= www.mymainwebsite.co.uk /的子程序',用户名= 'XXX',口令='XXX ”,的authType = '基本',includeAcls = 'FALSE'   -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:“SubApplication \ obj \ Test \ Package \ SubApplication.SetParameters.xml”   -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发布向导中运行,将站点/应用程序属性设置为www.mymainwebsite.co.uk/SubApplication,因此我知道它不是服务器上的权限问题。

我是否遗漏了msdeploy参数中的内容?

2 个答案:

答案 0 :(得分:9)

我在命令行中使用以下命令来设置Web应用程序:

-setParam:name="IIS Web Application Name",value="www.mymainwebsite.co.uk/SubApplication"

答案 1 :(得分:0)

为了对主站点的子应用程序进行Web部署,请转到TFS,部署IIS应用程序步骤,将覆盖参数更新为此类

name =“IIS Web应用程序名称”,value =“MainSite / SubApplication”

它应该做的伎俩!!

相关问题