0

I am new to .Net. I started coding in Visual Studio 2022 and was following a tutorial on YouTube. when I create my Console App I see difference:

This is the screenshot of the ide.

enter image description here

Program.cs looks different in this new project.

// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

I was expecting

using System;

namespace MyApp // Note: actual namespace depends on the project name.
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

After googling I found out that they hide the Main and using directives.

Now, my question is what are the using directives that they added in this default code?

If I do not want some of the directives how can I get rid of them?

How can I add new directives?

Hope my question makes sense, please let me know if you need any other information.

Guru Stron
  • 42,843
  • 5
  • 48
  • 70
Talha Tayyab
  • 2,102
  • 9
  • 14
  • 25

0 Answers0