I have a C# window's app that uses the OpenFileDialog from a Linklabel onclick event. When I run it on my PC the dialog box opens, however when other users run it, the dialog box does not open. I'm running Window's 7 Ent Ed 64 bit, the other users are running same OS but 32 bit. The platform in the app is set at x86.
Here's the code:
public string GetFile()
{
string selectedfile;
OpenFileDialog ofd = new OpenFileDialog();
DialogResult dr = ofd.ShowDialog();
if (dr == DialogResult.OK)
{
selectedfile = ofd.FileName;
}
else
{
selectedfile = null;
}
return selectedfile;
}
Has anyone else has this experience?
Bhushan GawalePosted Jan 8, 2015, 9:26 AM
any specific reason behind keeping platform to x86? try to set it to AnyCPU and try again.
Also you might want to take a look at this
https://social.msdn.microsoft.com/Forums/vstudio/en-US/ac25ad67-6cce-44de-b105-ee8f6a190a88/openfiledialog-unhandled-systemaccessviolationexception-only-over-windows-7-32bits?forum=csharpgeneral