I have a Visual Studio 2015 C# project that has a link to some external file.
<None Include="..\File.data">
<Link>File.data</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
I want to copy this file (if it has been modified) to the output directory (as the above msbuild statement would do), but also want to change its name (e.g. to "Sample.data").
Is there an easy way to do this with the builtin msbuild tasks?
Not sure for 2015. But in 2017 you can simply rename the tag.
<None Include="..\File.data">
<Link>Sample.data</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With