![]() ![]() (If you do catch an exception then you can also examine the exception's StackTrace property, but this is something that should only ever be logged internally and never displayed to a user). If you then run the program from within Visual Studio in debug mode your program will crash - but now the debugger will show you details on where the program is. If the 'Line numbers' check box is checked and you still don't see the lines, uncheck the check box, click OK, the go back to Tools -> Options -> Text Editor -> All Languages, now check the 'Line numbers' check box again and the lines should appear. So.as Wyck says, just remove the catch block. ![]() The only situations where you should catch exceptions are described in the same blog post I always point people to! Which is this one: For example, if you type Foo Bar instead of FooBar, Navigate To will still return useful results. It helps you locate items in your code by using fuzzy search capabilities. ![]() If you catch it and just allow the user to continue on, it means your program could now be in an unstable state and behave unpredictably. Navigate To (Ctrl+comma), new for Visual Studio 2010, is a powerful way to search, especially when you’re not sure exactly what you’re looking for. (hence the name) and usually mean something has gone very wrong with your program. The general guidelines is that you shouldn't actually catch exceptions except in some very specific situations.Īfter all, exceptions should only occur in exceptional circumstances ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |