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.

  1. Open the "Tools" menu, and click "Options".

  2. Expand "Projects and Solutions".

  3. Click on "Build and Run" tab.

  4. In the "On Run, when projects are out of date" dropdown, select "Always build".


Go menu ToolsOptions. Under Projects and SolutionsBuild 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).