Tech Journal Back to Tech Journal

Whey did I get a MissingMethodException for System.Windows.Forms.OpenFileDialog.get_SafeFile?

My program logged an MissingMethidException for a method called System.Windows.Forms.OpenFileDialog.get_SafeFile (which is simply the getter for System.Windows.Forms.OpenFileDialog.SafeFile).

This happened to me when a client clicked on a menu item titled "Open File...", and it turns out that OpenFileDialog.SafeFilename only exists on .NET 2.0 SP1 or .NET 3.0 (I'm not clear on which). There are a couple of discussions on the matter.

Bottom line: If you're using .NET 2.0 (for whatever reason), then don't use OpenFileDialog.SafeFilename - use OpenFileDialog.Filename.

Last updated on 2009-12-10 01:26:14 -0700, by Shalom Craimer

Back to Tech Journal