DCSIMG
February 2011 - Posts - Baruch Frei
Sign in | Join | Help

February 2011 - Posts

CustomizableOutDir In Team Build 2010

Published at Feb 22 2011, 10:48 AM by BaruchF

The default behavior of Team Build is to override the Output Directory

defined in the compiled project and direct all outputs to Binaries Dir.

But, sometimes this behavior is not good either because of Solutions

dependencies either because we want our outputs in specific

structure.

In Team Build 2008 there was a predefined property for that reason

“CustomizableOutDir” that if it set to true output directories  are not

overridden.

In Team Build 2010 (as part of moving from MSBuild to Workflow) this

Property is gone.

A while ago Jim Lamb posted about a way to achieve similar results

in Team Build 2010 using “TeamBuildOutDir” property.

But, if you simply want to live Output Directory as defined in the

projects ,there is a simpler way to do it.

Just open Build Template in xaml editing mode search for this string

OutDir="[BinariesDirectory]" you will find it twice one in the
Clean Task:
<mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[platformConfiguration.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" OutDir="[BinariesDirectory]" Platform="[platformConfiguration.Platform]" Project="[localBuildProjectItem]" Targets="[New String() { &quot;Clean&quot; }]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />
 And one in the Build Task 
<mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[platformConfiguration.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" LogFileDropLocation="[logFileDropLocation]" OutDir="[outputDirectory]" Platform="[platformConfiguration.Platform]" Project="[localProject]" RunCodeAnalysis="[RunCodeAnalysis]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />

Just delete this argument and you are done.

leave everything else like this:

<mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, MSBuildArguments)]" Configuration="[platformConfiguration.Configuration]" DisplayName="Run MSBuild for Project" GenerateVSPropsFile="[True]" LogFileDropLocation="[logFileDropLocation]" Platform="[platformConfiguration.Platform]" Project="[localProject]" RunCodeAnalysis="[RunCodeAnalysis]" TargetsNotLogged="[New String() {&quot;GetNativeManifest&quot;, &quot;GetCopyToOutputDirectoryItems&quot;, &quot;GetTargetPath&quot;}]" ToolPlatform="[MSBuildPlatform]" Verbosity="[Verbosity]" />

That’s it!

Msbuild for Website & the slippery “_PublishedWebsites” folder

Published at Feb 13 2011, 03:30 PM by BaruchF

I got request from one of our clients about wired behavior of the

Team Build.

In some of the builds for Web projects the build creates a

_PublishedWebsites folder under drop location and arranges all

WebSites\WebApplications\WebService under this folder very nice.

But in other builds this folder is missing even though all web projects

compiled successfully. It just drops all compiled materials under drop

location.

As I remember it should just work Out Of The Box.

For testing I created new solution with WebApplication and WebSite.

Created simple build definition using default template and built it.

image

As you can see it worked !

 

After a little research it came out that this is behavior of the MSBuild:

When building Web Project in MSBuild if you specify an OutDir

property (for overriding the default OutDir specified in the project),

it creates the _PublishedWebsites folder under specified OutDir.

If you do not set this property (MSBuild will use Default OutDir from

the project) this folder is not created.

So, default behavior of Team Build is to override OutDir property in

order to send outputs to Binaries folder.But in this  particular case

Team Build used customized templates that do not overrides OutDir…

How to do it in Team Build 2010 in the next post.

 

Happy Building !

TFS 2010 - Build Details Log View Is Very Slow

Published at Feb 08 2011, 08:32 PM by BaruchF

A while ago I posted about a bug in viewing the Build Details Log

inside Visual Studio.

I’ve also submitted bug on the Connect web site, but the answer

was “suppress warning level”.

Now there are  news : A good one and A bad one.

I’ll start with the good one: This is officially a bug and will be fix

in the next release.

The bad one is that right now, if you have a big Project to build

that includes a lot of solutions and projects (we have like 70

solutions with more than 700 projects that all depends on each

other) you have nothing to do…

More details in Jason Prickett Blog in this post.

You can find some helpful tips there as well.

Happy Building !