I tried to show folderbrowserdialog
in wpf but I got this exception
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process
I tried to add [STAThread] before this function but no change how can I solve this exception ?
The function is :
private void Save_any_File()
{
System.Windows.Forms.FolderBrowserDialog get_location = new System.Windows.Forms.FolderBrowserDialog();
get_location.ShowDialog();
}