I'm required to add a target to my csproj file which specifies input files as well as output files. Going by this link, I tried to define my target like so:
<ItemGroup>
<ins Include="A.txt" />
<outs Include="B.txt" />
</ItemGroup>
<Target Name="ExecuteTarget" Inputs="@(ins)" Outputs="@(outs)">
<Exec Command="echo hello world" />
</Target>
The intention here is to echo hello world in the Visual Studio output window every time the csproj is built in VS IDE if and only if the file A.txt is newer than B.txt OR B.txt does not exist. Both A.txt and B.txt exist in the same directory as the csproj file.
However, this does not seem to work as I'm not able to get the string "hello world" to print in the output window when I build this csproj. I'm using VS 16.11.5 along with .NET 5.0 enabled csproj (WinUI).
Any help/ideas/suggestions will be greatly appreciated.