DEV Community

Discussion on: Why does my winforms app close after a few seconds of loading?

Collapse
 
iankloppers profile image
Ian Kloppers • Edited

Hi Calin,

Try adding the [STAThread] attribute to your Main function, like this:

[STAThread]
static void Main() {
}
Enter fullscreen mode Exit fullscreen mode

Hope this helps.

Ian

Collapse
 
baenencalin profile image
Calin Baenen

Unfortunately, this did not help. I tried putting it both above the Main method, and the method that calls Application.Run, but in both cases, it still retains the quality of loading, and "Not responding".