STAThread missing, but it is there

前端 未结 5 972
遥遥无期
遥遥无期 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:10

    Try setting breakpoints at the main procedure, the point where the dialogbox is created, and where it is used. Then look at what thread(s) you actually are in. Also, check what the value of Thread.CurrentThread.GetApartmentState() is at those points.

提交回复
热议问题