Search code examples
msbuildazureteamcityteamcity-7.0

What parameters does TeamCity pass to MSBuild under the covers?


I just downloaded TeamCity 7 today and decided to get it up and running for my Azure solution. I am not trying to do anything fancy (yet) and started with a very basic command line build:

msbuild /t:Publish /p:Configuration=Release;TargetProfile=Production;PublishDir=S:\HoursTracker\Deployments

This builds successfully and produces a package that looks like this*:

enter image description here

I then attempted to configure TeamCity in an identical fashion:

enter image description here

This builds successfully and produces a package that looks like this*:

enter image description here

What I don't understand is why there is such a huge discrepancy in the size of the MVC project. Publishing directly from Visual Studio produces the exact same result as my MSBuild command so I'm convinced that TeamCity is the odd man out. Since I assume TeamCity is not broken, can someone please educate me on how to properly configure it so that I get the expected output?

*I have renamed the package files with .zip so that the details were viewable for this post.


Solution

  • Ming's answer helped me solve the mystery. After inspecting the contents of the zip files, I discovered the difference was that my MSBuild package contained bin and obj folders and the TeamCity package did not.

    enter image description here

    After making this discovery, I realized that I could specify multiple targets to MSBuild and prepended "Clean" to my targets switch like so:

    msbuild /t:Clean;Publish /p:Configuration=Release;TargetProfile=Production;PublishDir=S:\HoursTracker\Deployments
    

    As expected, this removed those folders. So apparently, TeamCity specifies "Clean" implicitly for you. Mystery solved.