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?
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?
Change the output type from Console Application to Windows Application. This can be done under Project -> Properties -> Application in Visual Studio:

Console.ReadLine. It doesn't make any sense if you don't have a console window.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.
You can use user32.dll to achieve this without vscode
class start
{
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
static void Main()
{
IntPtr h = Process.GetCurrentProcess().MainWindowHandle;
ShowWindow(h, 0);
// Do the rest
This still flashes the screen but works good enough
the usings are
using System.Runtime.InteropServices;
using System.Diagnostics;
Note im still new to csharp and not perfect so feel free to comment and corrections!
using System; [this will normally be in use for anything except the most trivial of programs, of course].Maybe you want to try creating a Windows Service application. It will be running in the background, without any UI.