There are two different versions of OpenFileDialog.
One belongs to the namespace System.Windows.Forms.
https://msdn.microsoft.com/en-us/library/e61ft40c(v=vs.110).aspx
The other one belongs to the namespace Microsoft.Win32.
https://msdn.microsoft.com/en-us/library/ms614336(v=vs.110).aspx
Have a look at the using session on top of your source code.
I am sure you have referenced System.Windows.Forms.
In order to compare the return value of ShowDialog to a nullable bool
you must replace
using System.Windows.Forms
by
using Microsoft.Win32
Make sure you added the corresponding reference.