❔ Only one compilation unit can have top-level statements. [C# start]
using VS code, just created new file apart from program.cs and got this error
Program.cs looks like this for example:dotnet new console presumablydotnet run
/close Program.csdotnet new consoledotnet runpublic class AClassInYourOtherFile
{
public static void DoSomething()
{
// your code for this method
}
}using System;
Console.WriteLine("hello world");using System;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("hello world");
}
}