Skip to content

Instantly share code, notes, and snippets.

@tgouala
Last active March 11, 2018 09:59
Show Gist options
  • Save tgouala/9c00b2b67ffdddcfd751558999223782 to your computer and use it in GitHub Desktop.
Save tgouala/9c00b2b67ffdddcfd751558999223782 to your computer and use it in GitHub Desktop.
How to move output referenced .dll to a new folder with MSBuild
<Target Name="AfterBuild"
>
<ItemGroup>
<SharedFiles Include = "%(Reference.HintPath)"
Condition="'%(Reference.Private)' != 'False' And '%(Reference.HintPath)' != ''">
<Path>%(Reference.HintPath)</Path>
</SharedFiles>
</ItemGroup>
<Copy
SourceFiles="$(OutputPath)$([System.IO.Path]::GetFileName('@(SharedFiles -> %(SharedFiles.Path)'))"
DestinationFolder="$(OutputPath)/Shared"
/>
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment