4 Replies
It means you never create an instance of that class, ie
var x = new Program();
Given your code, it's also possible you're trying to do an assembly instead of a Console-type (read: exe), so VSCode assumes you need to initialise the code.
Add this to the properties group of the CSProj, if you're just trying to write a Console app:
<OutputType>Exe</OutputType>
you can also define the Program class as static to remove the warning
public static class Program
Yes, make it static and internal and then you have a proper entry program class
You can also remove it entirely
https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/top-level-statements