使用msdeploy.exe将文件夹部署到远程站点

时间:2016-11-03 15:06:33

标签: msdeploy

我正在尝试为msdeploy找到正确的参数。 我有一个包含我想要部署的Web内容的文件夹。

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3"\msdeploy.exe -verb:sync -source:contentPath="c:\work\WebPackage" -dest:contentPath="Default Web Site",computername="http://10.7.5.93",username='\localuser',password=aPassword

我收到此错误:

Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the remote computer ("10.7.5.93"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Deployment Agent Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: Unable to connect to the remote server
Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.7.5.93:80
Error count: 1.

无法找出正确的语法。我可以使用此发布文件从VS部署:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>https://kitostest.miracle.dk</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <MSDeployServiceURL>http://10.7.4.93</MSDeployServiceURL>
    <DeployIisAppPath>Default Web Site</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>\deploy</UserName>
    <_SavePWD>True</_SavePWD>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>True</EnableUpdateable>
    <DebugSymbols>False</DebugSymbols>
    <WDPMergeOption>DonotMerge</WDPMergeOption>
    <PublishDatabaseSettings>
      <Objects xmlns="">
        <ObjectGroup Name="KitosContext" Order="1" Enabled="False">
          <Destination Path="" />
          <Object Type="DbCodeFirst">
            <Source Path="DBMigration" DbContext="Infrastructure.DataAccess.KitosContext, Infrastructure.DataAccess" MigrationConfiguration="Infrastructure.DataAccess.Migrations.Configuration, Infrastructure.DataAccess" Origin="Configuration" />
          </Object>
        </ObjectGroup>
      </Objects>
    </PublishDatabaseSettings>
  </PropertyGroup>
  <ItemGroup>
    <MSDeployParameterValue Include="$(DeployParameterPrefix)KitosContext-Web.config Connection String" />
  </ItemGroup>
</Project>

屏幕拍摄部署参数: enter image description here

所以我需要找到一种方法将参数映射到msdeploy。

这是我上次的尝试:

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3"\msdeploy.exe -whatif -verb:sync -source:contentPath="C:\work\WebPackage" -dest:contentPath='M:\Website',ComputerName="http://10.7.5.93/msdeploy.axd?site=Default Web Site",UserName='\ALocalUser',Password='MyPassWord',AuthType='Basic'

Syntak来自文章How to publish the contents of a folder with msdeploy.exe contentPath

的语法

我让它上班!!!在进行Web部署时,我使用fiddler监视visual studio。它将我的网站称为site / MSDEPLOYAGENTSERVICE而不是site / msdeploy.axd。我不是在网络服务器上安装msdeploy的人,但是如果我read the manual那么我本可以节省5个小时的挫折。

1 个答案:

答案 0 :(得分:2)

看起来没有&#34;默认网站&#34;?尝试添加您发布的网站名称:

fclose

取决于如何创建内容,您可能需要在msdeploy行中进行其他更改,但我会首先尝试。