I have a post-build event set up in Visual Studio 2010. The problem I am having is that the event doesn't run when I use Run (F5) to start debugging--it only seems to run if I explicitly Build (F6).
This seems to happen even when source files have changed (so it must build in order to run).
Is there a setting that controls this behavior?
In the Post-build event command line box, specify the syntax of the build event. Add a call statement before all post-build commands that run . bat files. For example, call C:\MyFile.
F5 & Ctrl-F5 F5 is used to start your project in debug mode and Ctrl-F5 is used to start your project without debug mode.
Go to Solution Explorer and right-click on the project then select Properties then go to the Build Events tab.
If you go to the Properties page for your project, you should select the Build Events tab. You can type in the call to your batch file in the Post-build event command line text box. If you want to refer to the batch file using the paths included in the project or solution, you can click on the Edit Post-Build...
Postbuilds are only run after building. So when your build artifacts are up to date, it will not build and postbuilds will not run.
If it even won't run when it has to build, check the following:
In Visual Studio look at Tools -> Options -> Projects and Solutions -> Build an Run.
Is the option "Only build startup projects and dependencies on Run" checked?
Try to uncheck that option.
What is the value of the option "On Run, when projects are out of date"? It should be "Prompt to build" or "Always build" to be sure to trigger a build when pressing F5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With