To execute a post-build command Visual C++ offers settings for both debug and release mode. Visual C# does not. To execute a post-build command based on debug or release mode use the following construct:
if $(ConfigurationName) == Release d:\test.exe $(TargetPath)