-1

I have confused with a convention followed by Main method.. If talk about Main method of windows form application that is decorated with [STAThread] attribute.

And Main method of console application there is no such kind of attribute. So I want to know what is meant by this attribute and why we need it in WinForm and not in Console.

Andrey Tretyak
  • 3,043
  • 2
  • 20
  • 33

1 Answers1

2

This attribute allows the app to communicate with COM components. Such as system dialogs and such.

A console app does not need this communication.

David Pilkington
  • 13,528
  • 3
  • 41
  • 73