Archive

Posts Tagged ‘msbuild’

Visual Studio 2010 Publish Command from msbuild Command line

July 15th, 2010

Seems like there a bunch of confusion about how to produce the “Publish” behavior provided by Visual Studio 2010 from msbuild 4 command line. The question I keep seeing over and over again is: How do I publsih the output of a web application with web.config tranformations included. This should get the job done:

msbuild solution.sln 
/p:Configuration=Release;DeployOnBuild=true;
DeployTarget=Package;_PackageTempDir=..\publish
  • Facebook
  • Twitter
  • Delicious
  • Reddit
  • StumbleUpon
  • Share/Save/Bookmark
Author: Categories: Uncategorized Tags:

Custom SolutionRoot in TFSBuild

June 29th, 2009

So I’m working through an issue trying to copy the build results from the local build location on the build machine to the drop location. I need to to do this manually because I need my solution to be built exactly the way it is built from the IDE, to keep file references in tact. This should be simple, right? Wrong. It seems that the $(SolutionRoot) property is not set to the value of Local Folder in your build definition. The value for $(SolutionRoot) does not seem to affected by customizing this value.

A simple work around to this is to use the $(Solution) property instead, it actually provides the location of the sln file itself. So with a bit of manipulation we can gather our real solution root location. Here is an example of how we can manipulate the value provided by $(Solution) to get the actual solution root.

<Target Name="AfterCompileSolution">
    <ItemGroup>
        <SolutionOutputs Include="$(Solution)\..\**\*.*" />
    </ItemGroup>

    <Copy SourceFiles="@(SolutionOutputs)" DestinationFolder="$(DropLocation)\$(BuildNumber)\%(Directory)%(RecursiveDir)" ContinueOnError="true" />
</Target>
  • Facebook
  • Twitter
  • Delicious
  • Reddit
  • StumbleUpon
  • Share/Save/Bookmark
Author: Categories: Code Tags: ,