Articles → CSHARP → File Scoped Namespace In C# 10.0File Scoped Namespace In C# 10.0In this article, we will discuss file scoped namespace in C# 10.0.Purpose In the previous C# versions, we declare the namespace in the following way: -namespace FileScopeNamespace { internal class FileScopeNamespace { } }In C# 10.0, we have come up with the file-scoped namespace feature. In this feature, we add a semicolon (;) after declaring the namespace. namespace FileScopeNamespace; internal class FileScopeNamespace { }Benefit The file scope namespace removes the additional indentation.Posted By - Karan Gupta Posted On - Thursday, October 6, 2022 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
namespace FileScopeNamespace { internal class FileScopeNamespace { } }
namespace FileScopeNamespace; internal class FileScopeNamespace { }
Query/Feedback