tags:

views:

1381

answers:

3

My application has no forms. It runs by calling Application.Run();

+4  A: 

Call System.Windows.Forms.Application.Exit();

Haim Bender
Did you use puppet accounts to upvote this question?
Esteban Araya
Er.. answer, I meant answer.
Esteban Araya
+1  A: 

The other option is Environment.Exit(), however if your application does rely on the Application classes, System.Windows.Forms.Application.Exit() is the more "proper" way of handling it.

Ryan Taylor
A: 

Just like the MSDN documentation for the Application.Run() suggests:

Note, that most Windows Forms developers will not need to use Application.Run(). Are you sure you need message pumping in your app?

Rinat Abdullin