Build Error Dialog In Visual Studio

Problem Statement

 
When you are in between writing your logic and by mistake you press F5, what will happen? Boom… you will end up with the below dialog due to compilation errors:
 
Build Errors Dialog In Visual Studio
 

Background

 
Now, think about it. If we are writing code, it means we need that to be executed whenever we are running the application. Isn’t it? It’s a very very rare case when someone still would like to execute previous logic, at least for me. I never ever want this to happen.
 

Solution

 
So, how to get rid of this rarely used, or better to say unused dialog? This can be done in 2 ways.
  1. Simply, check the checkbox ‘Do not show this dialog again’. But for me, on one of my machines, this checkbox has not even appeared. Hence, I opted for the second option.
  2. Go to Tools >> Options… >> Projects and Solutions >> Build and Run. On the right-hand side panel, just change the value in dropdown displayed under ‘On Run, when build or deployment errors occur:’ to 'Do not Launch' and we are done.
Build Errors Dialog In Visual Studio
 
Now, going forward, you will never see that dialog until and unless the build is successful. Hope you like this small trick.