JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

Code syntax style: file-scoped namespaces

Last modified: 11 February 2024

Starting from C# 10, you can use file-scoped namespace declarations in files containing a single namespace.

If you prefer to stick to either file-scoped or block-scoped namespace declarations, JetBrains Rider lets you configure your preferences and maintain the consistency of your preferences throughout your codebase.

JetBrains Rider helps you enforce preferences for file-scoped namespaces in the existing code and takes your preferences into account when it produces new code with code completion and code generation features, applies code templates and performs refactorings.