Question on "CoreCompile" target in file Microsoft.TeamFoundation.Build.targets?

Why invoke targets through call to “MSBuild” instead of using DependsOnTargets and dividing up the targets accordingly?

MSBuild task is a standard task shipped with .NET Framework (refer Microsoft.build.tasks.dll). It is used to build both solutions (sln) and projects (.xxproj) files. In Team Build we are using MSBuild tasks to call build and publish targets on the sln files that user has asked us to build. The build and publish are standard MSBuild targets for solutions (refer Microsoft.Common.Targets). Please note that sln file is not MSBuild formatted file and MSBuild does some special processing to convert it into MS Build formatted in-memory representation. The build or publish targets are invoked on this in-memory representation.

Why are we not using "DependsOnTargets"?

Consider a scenario where you are building 2 solutions Sln1.sln (consoleApp1.csproj) and Sln2.sln (consoleApp2.csproj). If you use the DependsOnTargets, you have to run “for” loop for each sln file and call the corresponding compile target. In our case, MSBuild task internally does all the processing. This results in a much better and more readable target file.

Comments

  • Anonymous
    October 12, 2005
    I am having real problems doing a Team Build of an ASP.Net app. Problem 1 is that whatever build configuration I specify when setting up the build type i.e. Debug|Any CPU I am given a warning that this is not a valid configuration. I suspect as this is only a warning thats not my real problem. Problem 2 is that the team build completes successfully however my website is not in the drop location. On inspecting the Build log, there was no attempt to compile as 'there are no outputs to the solution'.

    I have latterly tried replicating the 'Publish' command from the IDE in my Team Build in anattempt to get what I want in the drop location by editing the TFSBuild.proj file changing 'SolutionToBuild' to 'SolutionToPublish' but to no avail. Is there something I'm missing?
  • Anonymous
    October 13, 2005
    The comment has been removed
  • Anonymous
    August 12, 2009
    The comment has been removed