Tuesday 11 October 2011

Hide Console Window in C# Console Application; Run console application in a silent mode, KeepAlive Application or Service

The problem:
I created an window console application and run it as a windows scheduled task. But the console window flashes and goes back every time the app is run.

The solution
Option 1: (Best Option)
Change the output type from Console Application to Windows Application. This can be done under Project -> Properties -> Application in Visual Studio:

Option 2: Make a window service app using windows servicebase class

1 comment:

  1. Going to try option one today or tomorrow for a windows scheduled task cron job project. An email notification program that will run once a day.

    I'll leave a comment later to tell how it goes.

    ReplyDelete