How do I get this command line script to work in T

2019-09-09 17:38发布

问题:

I finally got a msbuild to execute and do a publish through the command line. Now I'm wondering how do I do that via teamcity?

When I run this command line it works!

C:\TFS\project\myProject\APIproject>msbuild apiproject.csproj /p:DeployOnBuild=true /p:PublishProfile="Properties\PublishProfiles\DEV.pubxml" /p:VisualStudioVersio n=14.0

However, I don't see a good solution in TeamCity to run this script.

回答1:

See the documentation: add an 'MsBuild' build step and populate the fields appropriately. Your commandline translated to these fields:

  • 'Build file path' relative/path/to/apiproject.csproj
  • 'Targets' I'm guessing 'Build' but can be left empty for the default
  • 'Command line parameters' here you can specify all properties like on the commandline. TeamCity might emit warnings because you do so, because the alternative and preferred way is to make all these properties TeamCity build parameters: TeamCity passes build parameters to MsBuild automatically.


标签: tfs msbuild