0

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.

webdad3
  • 8,893
  • 30
  • 121
  • 223
  • 1
    https://confluence.jetbrains.com/display/TCD8/MSBuild ? 'Build file path' = path/to/apiproject.csproj and you can specify the arguments as 'Command line parameters' or else make them TeamCity properties – stijn May 17 '16 at 16:55
  • that worked! If you want to add this as answer - I'll mark it. – webdad3 May 17 '16 at 17:40

1 Answers1

3

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.
stijn
  • 34,664
  • 13
  • 111
  • 163