System.Drawing in Windows or ASP.NET services

后端 未结 5 1056
遥遥无期
遥遥无期 2020-11-28 10:05

According to MSDN, it is not a particularly good idea to use classes within the System.Drawing namespace in a Windows Service or ASP.NET Service. Now I am d

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 10:49

    It might be something to do with the GDI subsystem needing an STA thread. If this is the case, investigate specifying ASPCOMPAT=TRUE in your @PAGE directive for the aspx page involved. This will run the aspx page in an STA thread, IIRC.

    -Oisin

提交回复
热议问题