.NET 6 new program style vs .NET 5 old program style

Greetings and salutations!

I have some basic knowledge of programming, but a complete beginner with C#.

I’m a bit confused with the new vs old program style.

I’m using VS Studio community with .NET6 and from what I understand the term top-level statements means the compiler generates the namespace, class, and method elements for the main program. Mostly works, but sometimes this creates errors when I try to follow along.

Should I go back to .NET5 or I’ll be ok with .NET6?

Besides the Windows docs, I didn’t find much info on this.

Thanks!

I think you should be able to use the old style even in .NET6. Have you tried it?

Thanks for the reply!

Hey I think you’re right. Seems I can create the project in .NET5, then change the framework settings to .NET 6. Should be all good.

Cheers,