How do I set Visual Studio to always build and debug when F5 is pressed?
You are probably working on a multi-project solution:
- Get properties of your solution (right click → Properties)
- Click on "Configuration Properties".
- Tick the "Build" check box for the project that is not compiled properly.
Open the "Tools" menu, and click "Options".
Expand "Projects and Solutions".
Click on "Build and Run" tab.
In the "On Run, when projects are out of date" dropdown, select "Always build".
Go menu Tools → Options. Under Projects and Solutions → Build and Run.
For "On Run, when projects are out of date:", choose "Always build". Now it should automatically build, and then run (unless there are errors; then the behavior here is dictated by the other setting right underneath it).