Hide Console Window in C# Console Application

The thing is, I really don't want the console window to show up, but the solution should be running. My point here is, I want to keep the application running in the background, without any window coming up.

How can I do that?


Solution 1:

Change the output type from Console Application to Windows Application. This can be done under Project -> Properties -> Application in Visual Studio:

alt text

Solution 2:

Change your application type to a windows application. Your code will still run, but it will have no console window, nor standard windows window unless you create one.

Solution 3:

Instead of Console.Readline/key you can use new ManualResetEvent(false).WaitOne() at last. This works well for me.