However, to use break on all exceptions, the app’s code should never throw exceptions under normal circumstances. There is a general programming principle behind this called fail fast.
![visual studio community mac debug arguments visual studio community mac debug arguments](https://visualstudio.microsoft.com/wp-content/uploads/2019/09/CodeConfidence.jpg)
It means that if anything in the app goes wrong, there is an immediate alert at the point of failure. As a general rule, it is a good idea to always debug with break on all exceptions turned on. Microsoft has a best practices guide that is also very useful. You should acquaint yourself with Exception handling in C# first and foremost. Watch the tutorial for Visual Studio on Mac It just means that if all is well, the app shouldn’t throw exceptions.
![visual studio community mac debug arguments visual studio community mac debug arguments](https://i.stack.imgur.com/ynZB9.png)
Note: let’s not get too caught up on the semantics of “apps and APIs should be designed so that under normal use, exceptions do not occur”. This feature has existed for most of the life of Visual Studio, so it should work on any Windows version. This guide targets Visual Studio on Windows, but the feature is very similar to the same feature on Visual Studio for Mac. Breaking in the debugger on all exceptions can help to diagnose issues at the source.
#Visual studio community mac debug arguments how to#
This article is a guide on how to turn on and use this feature.Įxceptions carry a stack trace with them, so they can provide a wealth of information about where the Exception arose from and why.
![visual studio community mac debug arguments visual studio community mac debug arguments](https://2.bp.blogspot.com/-bzNhczskwZM/UQpSF5WSgdI/AAAAAAAAAPg/TqdEMWemHyg/s1600/Visual-Studio-Debug-Options-General.jpg)
However, by default, Visual Studio projects don’t have this feature turned on. When debugging with the break on all exceptions feature is turned on, it is possible to get information about what went wrong immediately. Exceptions are an excellent way to tell the debugger or logging tools that something went wrong. However, developers should design apps and APIs so that under regular use, exceptions do not occur. An app should throw exceptions when something exceptional happens.