✅ Getting back main function
Recently after updating to CS8 (didnt update in a long time), and creating a console app there is no main function, how can i get it back?
4 Replies
it's technically not gone anywhere / you don't need it back, it's just using "top level statements" - it should have also inserted a comment with a link at the top of the file explaining what they are?
If not, here:
https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/top-level-statements
it wasnt there, ty
It might be because they were introduced a while ago so they've gotten rid of it now, not sure
What do you need it for?
You can get the passed in args via the
args
variable you can still access