我可以在Windows服务的Main中使用[STAThread],这有什么问题吗?
You can but it may not work as intended and can cause problems.
The best way to work around this seems to be by starting a new Thread and setting its ApartmentState to STA
Have a read of this post for more info:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.