I need some help writing a post build event that would work cross platform. The following in my csproj file will work on windows but not Unix. Thanks.
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y "$(TargetDir)bin\*.dll" "$(TargetDir)*.dll"" />
</Target>
For this specific case, it might be easier to use the MSBuild Copy Task.
In your csproj file:
<ItemGroup>
<MySourceFiles Include=$(TargetDir)\bin\*.dll"/>
</ItemGroup>
<Target Name="CopyFiles">
<Copy
SourceFiles="@(MySourceFiles)"
DestinationFolder="$(TargetDir)"
/>
</Target>
That being said, Windows will happily accept /
as a path separator, even mixing them in the same string.