Advertisement
uniblab

Improved Rename output file during build

Feb 24th, 2025
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.65 KB | Source Code | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project Sdk="Microsoft.NET.Sdk">
  3.     <PropertyGroup>
  4.         <AssemblyName>Foo</AssemblyName>
  5.     </PropertyGroup>
  6.     <ItemGroup>
  7.         <Content Include="LICENSE" CopyToOutputDirectory="Always" />
  8.     </ItemGroup>
  9.  
  10.     <Target Name="RmLicense" AfterTargets="Clean" Condition=" '$(OutDir)' != '' ">
  11.         <Delete ContinueOnError="false"
  12.             Files="$(OutDir)\$(AssemblyName).License.txt"
  13.         />
  14.     </Target>
  15.     <Target Name="MvLicense" AfterTargets="Build" Condition=" '$(OutDir)' != '' ">
  16.         <Move ContinueOnError="false"
  17.             SourceFiles="$(OutDir)\LICENSE"
  18.             DestinationFiles="$(OutDir)\$(AssemblyName).License.txt"
  19.         />
  20.     </Target>
  21. </Project>
Tags: MSBuild
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement