Visual Studio not auto-building when I press the debug button

I'm writing code in Visual Studio but whenever I want to test the application and press the green arrow for "Start debugging", Visual Studio does not automatically recompile the active solution for me and I have to manually build the solution then debug it.

Visual Studio used to automatically build before debug and I want this back as contantly having to manually build is a serious pain.

Thanks


Solution 1:

In the Visual Studio settings under Projects and Solutions->Build and Run change the option On Run, when projects are out of date: from Never Build to Always Build

Edit: Per your comments, open the "Configuration Manager" (in the Debug/Release dropdown) and ensure that the Build checkbox is checked for all of the projects you want to build in each of your configurations.

Solution 2:

  • Navigate to Debug > Options and Settings in the VS menu or Tools > Options...
  • Go to 'Projects and Solutions' > 'Build and Run' and make sure that the “Only build startup projects and dependencies on Run” box is left unchecked.