Visual Studio: Run C++ project Post-Build Event even if project is up-to-date

You can use the Custom Build Step property page to set up a batch file to run. This runs if the File specified in the Outputs setting is not found, or is out-of-date. Simply specify some non-existent file there, and the custom build step will always run. It will run even if your project is up-to-date, since the Output file is never found.


Use this DisableFastUpToDateCheck

See an example:

<PropertyGroup>
    <PostBuildEvent>IF  EXIST C:\Projects\Copy_Files_To_Instance.ps1 ( powershell -file C:\Projects\Copy_Files_To_Instance.ps1)</PostBuildEvent>
    <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>