-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
You can combine both modifiers to import the static members from a type in all source files in your project.
to all source files
Otherwise, compiler error CS1529 is generated.
That is truth only for using and using alias. For global using it is Error CS8914 A global using directive cannot be used in a namespace declaration. Also there exists Error CS8915 A global using directive must precede all non-global using directives. thus statement
In any namespace, but before any namespaces or types declared in that namespace, unless the global modifier is used, in which case the directive must appear before all namespace and type declarations.
should be reworded. Better to specify global using behavior – before other using types, not nested at top of file – separetely from using and using alias that are equal in their behavior.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 7569e51d-92c7-294a-2d5f-e1ab3c35fdf8
- Version Independent ID: 86a1c11a-1d3c-902b-6cf3-5c004c59a856
- Content: using directive - C# Reference
- Content Source: docs/csharp/language-reference/keywords/using-directive.md
- Product: dotnet-csharp
- Technology: csharp-language-reference
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn