Top level statement is not an option that you turn on or off. You just don't use it. You can add the standard boilerplate code (using, main, etc) in the main file. It is strictly an optional feature that you either use or not (like a lot of compiler features like var
and switch expressions). When you create a new project there is a checkbox you can check to not use top-level and it generates the initial code without it. But, again, this is completely optional and there is nothing to turn on or off.
The implicitusings
setting has nothing to do with top-level statements. What it does is enable the using of implicit usings in your C# code. By default you don't need to using system
because the compiler automatically brings it in and has since the earliest days of the language. But as more and more functionality is moved to other namespaces then the # of additional usings you have to have in your code explodes. To help cut down on all the extra usings you can define per-project implicit usings. If there is an implicit using in a project then you don't need to have a using for that namespace in any of your files.
This is a compiler option because if it is set then the NET SDK will add a series of common system namespaces to the implicit usings such as system
, System.Collections.Generic
, etc. If you are building framework apps like Winforms or WPF then the additional SDKs can add additional namespaces.