Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable/disable compile errors warning in Visual Studio

In debug mode, if there is an error in our application when we press F5 to start debugging, a dialog appears with the warning: "Your program has an error. Do you want to run your last modified program?" or something like this.

I want to enable or disable this dialog.

How can I do this?

like image 838
Tavousi Avatar asked Jan 17 '11 10:01

Tavousi


People also ask

How do I turn off errors in Visual Studio?

Select the rules you want to suppress, and then right-click and select Suppress > In Source. If you suppress In Source, the Preview Changes dialog opens and shows a preview of the C# #pragma warning or Visual Basic #Disable warning directive that is added to the source code.

How do you suppress warnings in VS code?

Suppress specific warnings for Visual C# or F# Or, select the project node and press Alt+Enter. Choose Build, and go to the Errors and warnings subsection. In the Suppress warnings or Suppress specific warnings box, specify the error codes of the warnings that you want to suppress, separated by semicolons.

How do I show warnings in Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.


1 Answers

You can turn that prompt on/off in your Visual Studio settings:

  1. From the "Tools" menu, select "Options".
  2. In the dialog that appears, expand "Projects and Solutions", and click "Build and Run".
  3. On the right side, you'll see a combo box labeled "On Run, when build or deployment errors occur".

    • If you want to disable the message box, select either "Do not launch" or "Launch old version" (which will launch the old version automatically).
    • If you want to enable the message box, select "Prompt to launch" which will ask you each time.

   VS "Build and Run" Options

Of course, as people have suggested in the comments, this means that your code has errors in it somewhere that are preventing it from compiling. You need to use the "Error List" to figure out what those errors are, and then fix them.

like image 67
Cody Gray Avatar answered Oct 25 '22 12:10

Cody Gray