Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
или Thread.CurrentThread.ApartmentState = ApartmentState.STA;
var fileDialog = new OpenFileDialog();
if(fileDialog.ShowDialog()==DialogResult.OK) { //code }
using System.Threading;
....
Thread.CurrentThread.ApartmentState = Threading.ApartmentState.STA;