Question

I'm using Resharper 8 and I'm quite happy but one thing makes me unhappy.
Resharper does not show me any exceptions a method could throw.
I would like to know without searching on MSDN if a method throws any exceptions.

I could not find anything about this on the internet except for a howto for an old version and this does not work anymore.
Is there any option I'm missing that I have to enable?

Edit: As I noticed IntelliSense only shows information about a method if I hover over it with my mouse. So no information is shown at all while typing. Really annoying.
Nothing on the internet helped yet. Neither the thread that was suggested this thread is a duplicate of nor any other suggesting turning on Tools->Text editor->C#->General->Parameter information/Auto list members or enableing Resharper->Environment->IntelliSense->Completion Appearance->Show summary/Show member signatures.
I can only see the member signature.

Was it helpful?

Solution

I don't think such a feature exists these days. There used to be Red Gate's Exception Hunter but it is discontinued with the following explanation:

With the release of .NET 4.0 and WPF, the number of exceptions that the CLR can throw was greatly increased, to the point of being overwhelming. The exclusions list can no longer cover all the unlikely exceptions that the CLR may throw. This means that, although Exception Hunter will provide accurate results, these results will include a long list of potential exceptions, most of which are nothing to worry about. In essence, the tool has become a lot less usable and makes your job harder than it should be. This goes against our ingeniously simple ethos, so we have decided to stop selling new licenses for the product.

From my experience, John Saunders is quite right - you should know the exact exception you want to handle, and handle it specifically. I guess it goes well with TDD.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top