diff --git a/docs/core/compatibility/sdk/8.0/implicit-global-using-netfx.md b/docs/core/compatibility/sdk/8.0/implicit-global-using-netfx.md index a3caa8d2c18a6..b1b5347e55366 100644 --- a/docs/core/compatibility/sdk/8.0/implicit-global-using-netfx.md +++ b/docs/core/compatibility/sdk/8.0/implicit-global-using-netfx.md @@ -31,7 +31,7 @@ Default projects should compile. If you relied on the implicit global `using` directive, you can: -- Add a [global `using` directive](../../../../csharp/language-reference/keywords/using-directive.md#global-modifier) to one of your source files. +- Add a [global `using` directive](../../../../csharp/language-reference/keywords/using-directive.md#the-global-modifier) to one of your source files. - Add a `using` directive to each source code file that uses APIs from System.Net.Http. ## Affected APIs diff --git a/docs/core/project-sdk/msbuild-props.md b/docs/core/project-sdk/msbuild-props.md index 55026a9c78454..34490c526d53e 100644 --- a/docs/core/project-sdk/msbuild-props.md +++ b/docs/core/project-sdk/msbuild-props.md @@ -1751,7 +1751,7 @@ For more information, see [Trimming options](../deploying/trimming/trimming-opti ### Using -The `Using` item lets you [globally include a namespace](../../csharp/language-reference/keywords/using-directive.md#global-modifier) across your C# project, such that you don't have to add a `using` directive for the namespace at the top of your source files. This item is similar to the `Import` item that can be used for the same purpose in Visual Basic projects. This property is available starting in .NET 6. +The `Using` item lets you [globally include a namespace](../../csharp/language-reference/keywords/using-directive.md#the-global-modifier) across your C# project, such that you don't have to add a `using` directive for the namespace at the top of your source files. This item is similar to the `Import` item that can be used for the same purpose in Visual Basic projects. This property is available starting in .NET 6. ```xml @@ -1772,7 +1772,7 @@ For example: - `` emits `global using Results = global::Microsoft.AspNetCore.Http.Results;` - `` emits `global using static global::Microsoft.AspNetCore.Http.Results;` -For more information, see [aliased `using` directives](../../csharp/language-reference/keywords/using-directive.md#using-alias) and [`using static ` directives](../../csharp/language-reference/keywords/using-directive.md#static-modifier). +For more information, see [aliased `using` directives](../../csharp/language-reference/keywords/using-directive.md#the-using-alias) and [`using static ` directives](../../csharp/language-reference/keywords/using-directive.md#the-static-modifier). ## Item metadata diff --git a/docs/core/project-sdk/overview.md b/docs/core/project-sdk/overview.md index ed73b42ef62bf..ab3bddc030929 100644 --- a/docs/core/project-sdk/overview.md +++ b/docs/core/project-sdk/overview.md @@ -116,7 +116,7 @@ If you explicitly define any of these items in your project file, you're likely ## Implicit using directives -Starting in .NET 6, implicit [`global using` directives](../../csharp/language-reference/keywords/using-directive.md#global-modifier) are added to new C# projects. This means that you can use types defined in these namespaces without having to specify their fully qualified name or manually add a `using` directive. The *implicit* aspect refers to the fact that the `global using` directives are added to a generated file in the project's *obj* directory. +Starting in .NET 6, implicit [`global using` directives](../../csharp/language-reference/keywords/using-directive.md#the-global-modifier) are added to new C# projects. This means that you can use types defined in these namespaces without having to specify their fully qualified name or manually add a `using` directive. The *implicit* aspect refers to the fact that the `global using` directives are added to a generated file in the project's *obj* directory. Implicit `global using` directives are added for projects that use one of the following SDKs: diff --git a/docs/csharp/language-reference/builtin-types/value-tuples.md b/docs/csharp/language-reference/builtin-types/value-tuples.md index d6bbfad2536c6..96ee3f87240d1 100644 --- a/docs/csharp/language-reference/builtin-types/value-tuples.md +++ b/docs/csharp/language-reference/builtin-types/value-tuples.md @@ -63,7 +63,7 @@ At compile time, the compiler replaces non-default field names with the correspo > [!TIP] > Enable .NET code style rule [IDE0037](../../../fundamentals/code-analysis/style-rules/ide0037.md) to set a preference on inferred or explicit tuple field names. -Beginning with C# 12, you can specify an alias for a tuple type with a [`using` directive](../keywords/using-directive.md#using-alias). The following example adds a `global using` alias for a tuple type with two integer values for an allowed `Min` and `Max` value: +Beginning with C# 12, you can specify an alias for a tuple type with a [`using` directive](../keywords/using-directive.md#the-using-alias). The following example adds a `global using` alias for a tuple type with two integer values for an allowed `Min` and `Max` value: :::code language="csharp" source="snippets/shared/ValueTuples.cs" id="AliasTupleType"::: diff --git a/docs/csharp/language-reference/compiler-messages/using-directive-errors.md b/docs/csharp/language-reference/compiler-messages/using-directive-errors.md index c8493d5941a72..beecded809ec8 100644 --- a/docs/csharp/language-reference/compiler-messages/using-directive-errors.md +++ b/docs/csharp/language-reference/compiler-messages/using-directive-errors.md @@ -154,7 +154,7 @@ In addition, if you define an alias named `global`, the compiler issues **CS0440 ## Alias name conflicts -You can declare an [alias](../keywords/using-directive.md#using-alias) to a namespace or a type with a `using` directive: +You can declare an [alias](../keywords/using-directive.md#the-using-alias) to a namespace or a type with a `using` directive: :::code language="csharp" source="./snippets/UsingDirectives/Program.cs" id="UsingAlias"::: diff --git a/docs/csharp/linq/index.md b/docs/csharp/linq/index.md index d4b2015d4def1..7ffe69058060c 100644 --- a/docs/csharp/linq/index.md +++ b/docs/csharp/linq/index.md @@ -14,7 +14,7 @@ The following example shows a complete query operation. The complete operation i :::code language="csharp" source="./snippets/linq-index/Index.cs" id="intro"::: -You might need to add a [`using`](../language-reference/keywords/using-directive.md) directive, `using System.Linq;`, for the preceding example to compile. The most recent versions of .NET make use of [implicit usings](../../core/project-sdk/overview.md#implicit-using-directives) to add this directive as a [global using](../language-reference/keywords/using-directive.md#global-modifier). Older versions require you to add it in your source. +You might need to add a [`using`](../language-reference/keywords/using-directive.md) directive, `using System.Linq;`, for the preceding example to compile. The most recent versions of .NET make use of [implicit usings](../../core/project-sdk/overview.md#implicit-using-directives) to add this directive as a [global using](../language-reference/keywords/using-directive.md#the-global-modifier). Older versions require you to add it in your source. ## Query expression overview diff --git a/docs/csharp/tour-of-csharp/overview.md b/docs/csharp/tour-of-csharp/overview.md index 3117561128e5d..b38f853d4d308 100644 --- a/docs/csharp/tour-of-csharp/overview.md +++ b/docs/csharp/tour-of-csharp/overview.md @@ -25,7 +25,7 @@ The preceding example shows one form of a "Hello, World" program, using [top-lev :::code language="csharp" interactive="try-dotnet" source="./snippets/shared/HelloWorld.cs"::: -This version shows the building blocks you use in your programs. The "Hello, World" program starts with a `using` directive that references the `System` namespace. Namespaces provide a hierarchical means of organizing C# programs and libraries. Namespaces contain types and other namespaces—for example, the `System` namespace contains many types, such as the `Console` class referenced in the program, and many other namespaces, such as `IO` and `Collections`. A `using` directive that references a given namespace enables unqualified use of the types that are members of that namespace. Because of the `using` directive, the program can use `Console.WriteLine` as shorthand for `System.Console.WriteLine`. In the earlier example, that namespace was [implicitly](../language-reference/keywords/using-directive.md#global-modifier) included. +This version shows the building blocks you use in your programs. The "Hello, World" program starts with a `using` directive that references the `System` namespace. Namespaces provide a hierarchical means of organizing C# programs and libraries. Namespaces contain types and other namespaces—for example, the `System` namespace contains many types, such as the `Console` class referenced in the program, and many other namespaces, such as `IO` and `Collections`. A `using` directive that references a given namespace enables unqualified use of the types that are members of that namespace. Because of the `using` directive, the program can use `Console.WriteLine` as shorthand for `System.Console.WriteLine`. In the earlier example, that namespace was [implicitly](../language-reference/keywords/using-directive.md#the-global-modifier) included. The `Hello` class declared by the "Hello, World" program has a single member, the method named `Main`. The `Main` method is declared with the `static` modifier. While instance methods can reference a particular enclosing object instance using the keyword `this`, static methods operate without reference to a particular object. By convention, when there are no top-level statements a static method named `Main` serves as the [entry point](../fundamentals/program-structure/main-command-line.md) of a C# program.