This PostBuildevent in Visual Studio works:
<Target Name="PostBuild" AfterTargets="PostBuildEvent"
Condition="$(TargetFramework)=='net7.0'">
<Exec Command="xcopy /y /d "$(ProjectDir)BM3DotNet64\*.dll" "$(TargetDir)"" />
</Target>
This however does not work:
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if $(TargetFramework)=='net7.0' ( xcopy /y /d "$(ProjectDir)BM3DotNet64\*.dll" "$(TargetDir)")" />
</Target>
The point is that I want the code to xcopy all dll's from a different directory ($(ProjectDir)BM3DotNet64) when the TargetFramework==net471) so I want to add a else statement as well. Adding a second <Target element with a different condition also does not work: only the second one is executed.
Where am I going wrong?