Teamcity 9x 忽略 MsBuild 参数

Teamcity 9x ignoring MsBuild parameters

我正在尝试使用 Teamcity 构建、打包和部署 Web 应用程序,但出于某种原因,Teamcity 忽略了我传递给 MsBuild.exe 的属性。

我在构建配置中创建了一个步骤来构建、打包应用程序并将其部署到本地服务器。以下是属性:

/P:Configuration=Release 
/P:DeployOnBuild=True 
/P:DeployTarget=MSDeployPublish 
/P:DeployIISAppPath=MyDeployedWebsitePath 
/P:AllowUntrustedCertificate=True 
/P:MSDeployPublishMethod=WMSvc 
/P:CreatePackageOnPublish=True 
/P:UserName=Administrator 
/P:Password=****** 
/P:MsDeployServiceUrl=MyServerName

将它们作为命令行参数传递给 MSBuild 步骤或将它们声明为参数选项卡中的系统属性似乎不起作用。 Teamcity 构建应用程序但忽略打包和部署步骤!

如果我在同一台服务器上通过命令行执行 MSBuild(使用相同的参数),打包和部署工作正常。

我正在按照 Troy Hunt 系列中提到的步骤进行操作:https://www.troyhunt.com/you-deploying-it-wrong-teamcity_26/

我已经阅读了很多堆栈溢出问题,它似乎对其他人来说是无缝的。我不确定出了什么问题。

如果有任何帮助,我将不胜感激。

更新 - 构建日志

> Step 2/2: Build (MSBuild) (51s)
[18:32:48][Step 2/2] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_18' value='0.0']
[18:32:48][Step 2/2] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\b12fe165603f4f19 /msbuildPath:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
[18:32:48][Step 2/2] in directory: C:\TeamCity\buildAgent\work\b12fe165603f4f19
[18:32:56][Step 2/2] Targets were not defined in the build configuration.
[18:32:56][Step 2/2] MSBuild command line parameters contain "/property:" or "/p:". It is recommended to define System Property on Build Parameters instead.
[18:33:02][Step 2/2] EnsembleID.Web\EnsembleID.Web.csproj.teamcity: Build target: Build (37s)
[18:33:40][Step 2/2] Process exited with code 0

原来是版本问题:/

我尝试了不同的 MSBuild 版本选项 - Microsoft .Net Framework 4.5、4.0 等。

最后,Microsoft Build Tools 2015 选项起作用了。

在过去的一周里,我一直在努力解决这个问题,但我忘记了我尝试过的所有不同排列。我已经安装了所有不同版本的框架工具和 Web 部署工具,我不确定为什么其他选项对我不起作用。因此,如果有人遇到类似问题,请务必尝试不同的 MSBuild 版本。