Welcome to MSDN Blogs Sign in | Join | Help

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.

Published Tuesday, October 11, 2005 3:04 PM by ManishAgarwal

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

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

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?
Wednesday, October 12, 2005 11:35 AM by Simon Burgess

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

Configurations (platform|flavor) defined in the proj (csproj, vbproj, etc) files or sln files are valid configurations. Team build is designed to just build valid configurations. If you try to build projects with the configuration that are not supported in the sln/proj files then team build will skip building the project and will raise the invalid configuration warning.

This should not cause the build to fail because team build is designed to build multiple solutions. Consider the scenario where you are building csharp project and ASP project. You want csharp project to build using “debug|Anycpu” and ASP project using “debug|.NET”. Then team build should skip building csharp project for “debug|.NET” and skip ASP project for “debug|Anycpu”.

In your case you are trying to build for configurations that are not supported by the ASP application sln file.

Thursday, October 13, 2005 10:33 AM by ManishAgarwal

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker