OpenFileDialog ShowDialog.Value Warning.

Everywhere I use the OpenFileDialog's ShowDialog function I use and most people I know use it like this:

OpenFileDialog dialog = new OpenFileDialog();

if (dialog.ShowDialog().Value)

And every time ReSharper shows a "Possible 'System.InvalidOperationException'", which I of course do not want to set to "Do not show" because it would hide it for other cases.
But as discussed here: SO Question the function will never really return null. Is there a way to exclude this special case from ReSharpers InvalidOperationException detection?
Or maybe even have the devs exclude it by default?


Please sign in to leave a comment.