Console Application or Scheduler or Process or Job in C#

Open VS2022 -> Create New Project -> Search Console App -> Select -> Next.

Create New Project

Enter Project Name and path -> Click Next.

Enter Project Name

Keep the framework as it is: - Click Create.

Keep the framework

Here, a New project has been created.

 New project

In Program.cs file – You don’t have any default class program. Delete all lines and add the below lines.

Program

Program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Code_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            string message = "Hello World!!";

            Console.WriteLine(message);
        }
    }
}

Run the program using F5 or the option below.

Run the program

Output

Output

In the same way, you can write your business logic Inside the main function.

Happy Coding!

Thanks.

Next Recommended Reading Use Log4Net in C# Console Application