Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# program without UI

Tags:

c#

Is it possible to make a Visual C# program that runs without a console or windows form? If so, how?

like image 286
Lienau Avatar asked Dec 02 '22 06:12

Lienau


2 Answers

Sure- set the build output type to Windows Application under Project Properties, and don't show a form in Main. You can do whatever you want in there- you just have to manage the lifetime of the app somehow (eg, how do you plan to shut it down?)

like image 149
nitzmahone Avatar answered Dec 18 '22 10:12

nitzmahone


You can also create a Windows Service app; start and stop the app via the Services Management console.

like image 32
Dour High Arch Avatar answered Dec 18 '22 10:12

Dour High Arch