Why am I getting a RPC server error using a SaveFileDialogue in a WinForms app?

1.3k views Asked by At

I'm getting an error when I try to use the SaveFileDialogue in a WinForms app. I must be missing something as the error makes no sense (to me!)!

The error is: "First-chance exception at 0x000007fefc99cacd in TestProject.exe: 0x000006BA: The RPC server is unavailable."

The error occurs when this line runs: "if (SD.ShowDialog() == DialogResult.OK)".

Here is my code:

var SD = new SaveFileDialog();
SD.Filter = "PDF (*.pdf)|*.pdf|Show All Files (*.*)|*.*";
SD.FileName = "Untitled";
SD.Title = "Save As";
if (SD.ShowDialog() == DialogResult.OK)
{
// DO SOMETHING HERE
}

Edit: I'm saving the file locally, but the error occurs before the user has even picked a location to save, it occurs at the point where I try to show the dialogue for the user to pick the location!

1

There are 1 answers

6
Steve On BEST ANSWER

Probably you have activated some flag in the Exceptions Debug Menu.
Try to reset to default configuration going to Debug -> Exceptions -> Reset All