System.MissingMethodException: Method not found: 'System.String

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

For my program I use the following code:

Dim dr As DialogResult
Dim ofd As New OpenFileDialog

ofd.DefaultExt = "*.*"
ofd.Filter = "All files|*.*"
ofd.FilterIndex = 0

ofd.Multiselect = False
ofd.ReadOnlyChecked = True
ofd.Title = "Selecteer de file"
dr = ofd.ShowDialog()

If dr = Windows.Forms.DialogResult.Cancel Then Exit Sub

Dim fileName As String = ofd.FileName

At my computer this works fine and no errors.
At a users computer I get the following error:

************** Exception Text **************
System.MissingMethodException: Method not found: 'System.String
System.Windows.Forms.OpenFileDialog.get_SafeFileName()'.
at VDL_Stock.frmEditStuklijst.FileToevoegen()
at VDL_Stock.frmEditStuklijst.llToevoegen_LinkClicked(Object sender,
LinkLabelLinkClickedEventArgs e)
at
System.Windows.Forms.LinkLabel.OnLinkClicked(LinkLabelLinkClickedEventArgs e)
at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.LinkLabel.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)


This user is like me using Vista.
My program is set to use only .NET 2.0

I do not user SafeFileName, so why this error?
How can I make this error go away?

rg,
Eric
 
For my program I use the following code:

Dim dr As DialogResult
Dim ofd As New OpenFileDialog

ofd.DefaultExt = "*.*"
ofd.Filter = "All files|*.*"
ofd.FilterIndex = 0

ofd.Multiselect = False
ofd.ReadOnlyChecked = True
ofd.Title = "Selecteer de file"
dr = ofd.ShowDialog()

If dr = Windows.Forms.DialogResult.Cancel Then Exit Sub

Dim fileName As String = ofd.FileName

At my computer this works fine and no errors.
At a users computer I get the following error:

************** Exception Text **************
System.MissingMethodException: Method not found: 'System.String
System.Windows.Forms.OpenFileDialog.get_SafeFileName()'.
at VDL_Stock.frmEditStuklijst.FileToevoegen()
at VDL_Stock.frmEditStuklijst.llToevoegen_LinkClicked(Object sender,
LinkLabelLinkClickedEventArgs e)
at
System.Windows.Forms.LinkLabel.OnLinkClicked(LinkLabelLinkClickedEventArgs e)
at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.LinkLabel.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

This user is like me using Vista.
My program is set to use only .NET 2.0

I do not user SafeFileName, so why this error?
How can I make this error go away?

rg,
Eric

Hi Eric,
In the snippet you've posted, it seems there's no usage of
SafeFileName property which is part of .NET 2.0 SP1 according to the
web. I suggest you to search entire code file again(can be done by
"Quick Find") for "SafeFileName" against any risk of usage of that
property that you may have missed to see.

If you have used SafeFileName and getting that exception, try to
switch it to "FileName" property instead.

Hope this helps,

Onur Güzel
(e-mail address removed)
(e-mail address removed)
 
This piece of code is the first in the button-click routine and the exception
comes when this button is clicked.
There is no other use of SafeFileName in the rest of the code.

rg,
Eric
 
Eric said:
For my program I use the following code:

Dim dr As DialogResult
Dim ofd As New OpenFileDialog

ofd.DefaultExt = "*.*"
ofd.Filter = "All files|*.*"
ofd.FilterIndex = 0

ofd.Multiselect = False
ofd.ReadOnlyChecked = True
ofd.Title = "Selecteer de file"
dr = ofd.ShowDialog()

If dr = Windows.Forms.DialogResult.Cancel Then Exit Sub

Dim fileName As String = ofd.FileName

At my computer this works fine and no errors.
At a users computer I get the following error:

************** Exception Text **************
System.MissingMethodException: Method not found: 'System.String
System.Windows.Forms.OpenFileDialog.get_SafeFileName()'.
at VDL_Stock.frmEditStuklijst.FileToevoegen()
at VDL_Stock.frmEditStuklijst.llToevoegen_LinkClicked(Object sender,
LinkLabelLinkClickedEventArgs e)
at
System.Windows.Forms.LinkLabel.OnLinkClicked(LinkLabelLinkClickedEventArgs
e)
at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.LinkLabel.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)


This user is like me using Vista.
My program is set to use only .NET 2.0

I do not user SafeFileName, so why this error?
How can I make this error go away?

rg,
Eric


Is installing SP1 an option for the machine that fails?
 
Back
Top