[C# Helper]
Index Books FAQ Contact About Rod
[Beginning Database Design Solutions, Second Edition]

[Beginning Software Engineering, Second Edition]

[Essential Algorithms, Second Edition]

[The Modern C# Challenge]

[WPF 3d, Three-Dimensional Graphics with WPF and C#]

[The C# Helper Top 100]

[Interview Puzzles Dissected]

[C# 24-Hour Trainer]

[C# 5.0 Programmer's Reference]

[MCSD Certification Toolkit (Exam 70-483): Programming in C#]

Title: Prevent Visual Studio from running programs with syntax errors

If a program's code contains syntax errors, then by default if you try to run the program Visual Studio displays the following message:

You should pretty much always click No. If you click Yes, an older version of the program runs so you won't see any of the changes that you recently made and you may incorrectly think the new code works properly. (This is a common beginner mistake.)

To prevent Visual Studio from even asking if you want to run the old version, follow these steps:

  1. Open the Tools menu and select Options.
  2. Expand the Options tree to go to Projects and Solutions > Build and Run. On the right, set "On Run, when build or deployment errors occur" to "Do not launch."

Now if you have syntax errors, Visual Studio displays them in the Error window, doesn't launch the old version of the program, and doesn't waste your time with the message box.

© 2009-2023 Rocky Mountain Computer Consulting, Inc. All rights reserved.