C
C#2mo ago
manuka

What does this mean

i know its just a ide recommendation but what does it mean
No description
4 Replies
Pobiega
Pobiega2mo ago
It means you never create an instance of that class, ie var x = new Program();
felsokning
felsokning2mo ago
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>
becquerel
becquerel2mo ago
you can also define the Program class as static to remove the warning public static class Program
FusedQyou
FusedQyou2mo ago
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
Want results from more Discord servers?
Add your server