【问题标题】:How to use MsDeploy to deploy a sub-application within a website如何使用 MsDeploy 在网站内部署子应用程序
【发布时间】:2012-08-31 08:40:56
【问题描述】:

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

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

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

这可行(www.mymainwebsite.co.uk 是 IIS 网站):

msdeploy.exe -source:package='www.mymainwebsite.co.uk\obj\Test\Package\www.mymainwebsite.co.uk.zip' -dest:auto,computerName='https://testweb1:8172/MsDeploy.axd?site=www.mymainwebsite.co.uk',userName='xxx',password='xxx',authtype='Basic',includeAcls ='假' -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:package='SubApplication\obj\Test\Package\SubApplication.zip' -dest:auto,computerName='https://testweb1:8172/MsDeploy.axd?site=www.mymainwebsite.co.uk/SubApplication',userName='xxx',password='xxx ',authtype='基本',includeAcls='假' -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 发布向导中起作用,将 Site/application 属性设置为 www.mymainwebsite.co.uk/SubApplication,所以我知道这不是服务器上的权限问题。

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

【问题讨论】:

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


    【解决方案1】:

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

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

    【讨论】:

    • 我正在使用msdeploy.exe –verb:sync -source:contentPath='E:\temp' -dest:contentPath='http://{IP}/testMsDeployOnIIS',ComputerName="https://{IP}:8172/msdeploy.axd?site=Default%20Web%20Site",UserName='MyUser',Password='MyPassword,AuthType='Basic' -enableRule:DoNotDeleteRule -whatif -allowUntrusted -setParam:name='IIS Web Application Name',value='http://{IP}/testMsDeployOnIIS'
    • 它给出以下错误信息...Error: Source does not support parameter called 'IIS Web Application Name'. Must be one of (). Error count: 1.
    • 无设置参数 ------c:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy.exe -verb:sync -source:co ntentPath='E:\temp' -dest:contentPath='http://{IP}/testMsDeployOnIIS',C omputerName="https://{IP}/msdeploy.axd?site=Default%20Web%20Site",U serName='MyUser',Password='MyPasseord',AuthType='Basic' -enableRu le:DoNotDeleteRule -whatif -allowUntrusted
    • 它给出以下消息.... Info: Using ID '8cce9292-0de0-49de-a192-d7d5fc0bcbfa' for connections to the rem ote server. Info: Adding MSDeploy.contentPath (MSDeploy.contentPath). Info: Adding virtual path (http://103.15.43.10/testMsDeployOnIIS) Error Code: ERROR_SITE_DOES_NOT_EXIST More Information: Site 'http:' does not exist. Learn more at: http://go.microso ft.com/fwlink/?LinkId=221672#ERROR_SITE_DOES_NOT_EXIST. Error count: 1.
    【解决方案2】:

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

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

    它应该可以解决问题!

    【讨论】:

      猜你喜欢
      • 2023-03-10
      • 1970-01-01
      • 2012-07-15
      • 1970-01-01
      • 1970-01-01
      • 2012-03-14
      • 1970-01-01
      • 1970-01-01
      • 2012-09-27
      相关资源
      最近更新 更多