VS 2010 - Always execute pre-build event

visual-studio-2010

Solution

For a `Visual C++` project you may specify `Command Line` in the `Custom build step` (`Configuration Properties` - `Custom build step`) and leave the field `Outputs` empty. It will be executed even if the project has no changes.

Here is the similar question.

Problem

In my solution I have a project with an attached pre-build event to check if certain files need to be regenerated. This all works fine if something changed in the project (or dependent projects). However, if nothing changed the pre-build event is not triggered. Is there a way to run the pre-build event everytime VS tries to build a project (even if it is clean from a code file standpoint)? Alternatively, is there any other way to run a script first before building a project so that I can regenerate my files first?

Original source

Related problems