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

Enter Project Name and path -> Click Next.

Keep the framework as it is: - Click Create.

Here, a New project has been created.

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

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.

Output

In the same way, you can write your business logic Inside the main function.
Happy Coding!
Thanks.

Join the conversation! Your thoughts help the community grow.