STAThread missing, but it is there

前端 未结 5 966
遥遥无期
遥遥无期 2020-12-01 22:24

Here is the error message that I am recieving when I try to open an OpenFileDialog in my program:

\"Current thread must be set to single thread apar

5条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 23:04

    t.SetApartmentState(ApartmentState.STA);
    

    The above line of code worked for me. once try it.

提交回复
热议问题