Skip to content

Instantly share code, notes, and snippets.

@sihugh
Last active August 29, 2015 14:21
Show Gist options
  • Save sihugh/38a234e0d4516007de30 to your computer and use it in GitHub Desktop.
Save sihugh/38a234e0d4516007de30 to your computer and use it in GitHub Desktop.
Build target example to copy built assembly to a stash area "BinStash"
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
StashOutput;
</BuildDependsOn>
<BinStash>$(SolutionDir)Bin\</BinStash>
<PostBuildEvent></PostBuildEvent>
</PropertyGroup>
<Target Name="StashOutput" Inputs="@(None);@(Content);$(OutDir)$(TargetFileName)" Outputs="$(BinStash)$(TargetFileName)">
<MakeDir Directories="$(BinStash)" Condition="!Exists('$(BinStash)')" />
<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFolder="$(BinStash)" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment