C
C#

✅ Getting back main function

✅ Getting back main function

RRBMKBlaze11/21/2023
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?
SSinFluxx11/21/2023
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
RRBMKBlaze11/21/2023
it wasnt there, ty
SSinFluxx11/21/2023
It might be because they were introduced a while ago so they've gotten rid of it now, not sure
PPixxelKick11/21/2023
What do you need it for? You can get the passed in args via the args variable you can still access

Looking for more? Join the community!

C
C#

✅ Getting back main function

Join Server
Want results from more Discord servers?
Add your server
Recommended Posts