Skip to content

Code Organization in C#

Every page here changes how C# code is laid out across files or projects.

FeatureIntroduced InWhy it belongs hereGuide
Global usingsC# 10.0Promotes project-wide imports.Guide
File-scoped namespacesC# 10.0Reduces indentation for one-namespace files.Guide
Top-level statementsC# 9.0Simplifies the startup file structure.Guide
File-based app directivesC# 14.0Keeps single-file app configuration inside the source file.Guide