我正在尝试将网站(不是 Web 应用程序)自动部署到本地测试服务器。从 VS2013 发布工作正常,但尝试使用 MSDeploy 从 TeamCity 8.1.4(内部版本 30168)运行它我不断收到以下错误:
无法启动 MSBuild.exe。未能在项目文件 \App_Data\PublishProfiles\DeployToLocalTest.pubxml 中检测到默认目标。请在 TeamCity Web UI 的构建配置选项中明确定义目标。Project 没有定义 DefaultTargets 或 InitialTargets。
构建步骤命令行参数:
/P:Configuration=%env.Configuration%
/P:DeployTarget=MSDeployPublish
/P:MsDeployServiceUrl=https://%env.TargetServer%/MsDeploy.axd?site=XXXX
/P:AllowUntrustedCertificate=True
/P:MSDeployPublishMethod=WMSvc
/P:CreatePackageOnPublish=True
/P:DeployIisAppPath=XXXX
/P:UserName=XXXX
/P:Password=XXXX
pubxml 文件如下(留有空间):
<WebPublishMethod>MSDeploy</WebPublishMethod>
<DeployTarget>WebPublish</DeployTarget>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>XXXX</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<MSDeployServiceURL>XXXX</MSDeployServiceURL>
<DeployIisAppPath>XXXX</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>XXXX</UserName>
<_SavePWD>True</_SavePWD>
注意:我已将敏感信息替换为 XXXX