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

4

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!

c#
winforms
c#-4.0
savefiledialog
first-chance-exception
asked on Stack Overflow Jun 4, 2012 by Faraday • edited Jun 4, 2012 by Faraday

1 Answer

3

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

answered on Stack Overflow Jun 4, 2012 by Steve

User contributions licensed under CC BY-SA 3.0