From a68e021a9b3be3c74b29ca9c0e64bd42ad6b221d Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 4 Mar 2026 15:30:10 -0500 Subject: [PATCH 01/34] Revise index 1. **Revise** `docs/csharp/fundamentals/program-structure/index.md` - Update frontmatter: set `ms.date` to current date, add `ai-usage: ai-assisted` - Rewrite to lead with a motivating example showing a modern C# program with file-scoped namespaces, global usings, and top-level statements as the default style - Distinguish the three application styles: file-based apps (C# 14), project-based apps with top-level statements, and `Main`-style project-based apps - Update the "Related Sections" links: change the Namespaces link from `../types/namespaces.md` to `namespaces.md` (since it moves into this directory) - Replace or modernize existing snippet references; consider whether existing `snippets/structure/` and `snippets/toplevel-structure/` need updating to latest .NET target and everyday C# features --- .../fundamentals/program-structure/index.md | 76 +++++++++++-------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 5a8a0a88ac7ca..87cb6b5231260 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -1,44 +1,60 @@ --- -title: "General Structure of a Program" -description: Learn about the structure of a C# program by using a skeleton program that contains all the required elements for a program. -ms.date: 06/20/2025 -helpviewer_keywords: +title: "General structure of a C# program" +description: Learn how C# programs are structured, including the three application styles—file-based apps, top-level statements, and Main method programs—and the building blocks that make up every program. +ms.date: 03/04/2026 +ai-usage: ai-assisted +helpviewer_keywords: - "C# language, program structure" --- -# General Structure of a C# Program +# General structure of a C# program -C# programs consist of one or more files. Each file contains zero or more namespaces. A namespace contains types such as classes, structs, interfaces, enumerations, and delegates, or other namespaces. The following example is the skeleton of a C# program that contains all of these elements. +A C# program is built from a few core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point—where your program starts running—depends on which application style you choose. -:::code language="csharp" source="snippets/toplevel-structure/Program.cs"::: +The following example shows a modern C# program that uses [file-scoped namespaces](namespaces.md), [top-level statements](top-level-statements.md), and everyday C# features: -The preceding example uses [*top-level statements*](top-level-statements.md) for the program's entry point. Only one file can have top-level statements. The program's entry point is the first text line of program text in that file. In this case, it's the `Console.WriteLine("Hello world!");`. -You can also create a static method named [`Main`](main-command-line.md) as the program's entry point, as shown in the following example: +:::code language="csharp" source="snippets/toplevel-structure/Program.cs"::: -:::code language="csharp" source="snippets/structure/Program.cs"::: +This example uses *top-level statements* for the program's entry point. Only one file in a project can have top-level statements, and the entry point is the first line of program text in that file. File-scoped namespaces (the `namespace YourNamespace;` syntax) reduce nesting by applying the namespace to the entire file. -In that case the program starts in the opening brace of `Main` method, which is `Console.WriteLine("Hello world!");` +## Three application styles -## Building and running C# programs +C# supports three styles for structuring an application's entry point. Choose the one that fits your scenario: -C# is a *compiled* language. In most C# programs, you use the [`dotnet build`](../../../core/tools/dotnet-build.md) command to compile a group of source files into a binary package. Then, you use the [`dotnet run`](../../../core/tools/dotnet-run.md) command to run the program. (You can simplify this process because `dotnet run` compiles the program before running it if necessary.) These tools support a rich language of configuration options and command-line switches. The `dotnet` command line interface (CLI), which is included in the .NET SDK, provides many [tools](../../../core/tools/index.md) to generate and modify C# files. +### File-based apps -Beginning with C# 14 and .NET 10, you can create *file-based apps*, which simplifies building and running C# programs. You use the `dotnet run` command to run a program contained in a single `*.cs` file. For example, if the following snippet is stored in a file named `hello-world.cs`, you can run it by typing `dotnet run hello-world.cs`: +Beginning with C# 14 and .NET 10, *file-based apps* let you run a program contained in a single `*.cs` file without a project file. Store the following code in a file named `hello-world.cs` and run it with `dotnet run hello-world.cs`: :::code language="csharp" source="./snippets/file-based-program/hello-world.cs"::: -The first line of the program contains the `#!` sequence for Unix shells. The location of the `dotnet` CLI can vary on different distributions. On any Unix system, if you set the *execute* (`+x`) permission on a C# file, you can run the C# file from the command line: +The `#!` line enables Unix shells to run the file directly. On any Unix system, set the *execute* (`+x`) permission and run the file from the command line: ```bash ./hello-world.cs ``` -The source for these programs must be a single file, but otherwise all C# syntax is valid. You can use file-based apps for small command-line utilities, prototypes, or other experiments. file-based apps allow [preprocessor directives](../../language-reference/preprocessor-directives.md#file-based-apps) that configure the build system. +File-based apps support all C# syntax and can use [preprocessor directives](../../language-reference/preprocessor-directives.md#file-based-apps) to configure the build system. Use file-based apps for small command-line utilities, prototypes, and experiments. + +### Top-level statements (project-based) + +For project-based apps, [top-level statements](top-level-statements.md) let you write executable code directly in one file, without wrapping it in a class and `Main` method. This is the default style when you create a new console app with `dotnet new console`. The first code example on this page uses this style. + +### Main method (project-based) + +You can also define an explicit static [`Main`](main-command-line.md) method as the program's entry point. This style is common in larger applications and when you need to control the method signature—for example, to return an exit code or accept `string[] args`: + +:::code language="csharp" source="snippets/structure/Program.cs"::: + +## Building and running C# programs + +C# is a *compiled* language. For project-based apps, use the [`dotnet build`](../../../core/tools/dotnet-build.md) command to compile source files into a binary package and [`dotnet run`](../../../core/tools/dotnet-run.md) to build and run in one step. The `dotnet` CLI, included in the .NET SDK, provides many [tools](../../../core/tools/index.md) to create, build, and manage C# projects. + +For file-based apps, `dotnet run hello-world.cs` compiles and runs the single file directly—no project file required. ## Expressions and statements -C# programs are built using *expressions* and *statements*. Expressions produce a value, and statements perform an action: +C# programs are built from *expressions* and *statements*. -An *expression* is a combination of values, variables, operators, and method calls that evaluate to a single value. Expressions produce a result and can be used wherever a value is expected. The following examples are expressions: +An *expression* evaluates to a single value. The following are expressions: - `42` (literal value) - `x + y` (arithmetic operation) @@ -46,28 +62,28 @@ An *expression* is a combination of values, variables, operators, and method cal - `condition ? trueValue : falseValue` (conditional expression) - `new Person("John")` (object creation) -A *statement* is a complete instruction that performs an action. Statements don't return values; instead, they control program flow, declare variables, or perform operations. The following examples are statements: +A *statement* performs an action. Statements control program flow, declare variables, or invoke operations. The following are statements: - `int x = 42;` (declaration statement) -- `Console.WriteLine("Hello");` (expression statement - wraps a method call expression) +- `Console.WriteLine("Hello");` (expression statement—wraps a method call expression) - `if (condition) { /* code */ }` (conditional statement) - `return result;` (return statement) -The key distinction: expressions evaluate to values, while statements perform actions. Some constructs, like method calls, can be both. For example, `Math.Max(a, b)` is an expression when used in `int result = Math.Max(a, b);`, but becomes an expression statement when written alone as `Math.Max(a, b);`. +Some constructs serve both roles. For example, `Math.Max(a, b)` is an expression when used in `int result = Math.Max(a, b);`, but becomes an expression statement when written alone as `Math.Max(a, b);`. -For detailed information about statements, see [Statements](../../programming-guide/statements-expressions-operators/statements.md). For information about expression-bodied members and other expression features, see [Expression-bodied members](../../programming-guide/statements-expressions-operators/expression-bodied-members.md). +For detailed information about statements, see [Statements](../../programming-guide/statements-expressions-operators/statements.md). For information about expression-bodied members, see [Expression-bodied members](../../programming-guide/statements-expressions-operators/expression-bodied-members.md). -## Related Sections +## Related sections -You learn about these program elements in the [types](../types/index.md) section of the fundamentals guide: +Learn about these program elements in the [types](../types/index.md) section of the fundamentals guide: -- [Classes](../types/classes.md) -- [Structs](../../language-reference/builtin-types/struct.md) -- [Namespaces](../types/namespaces.md) -- [Interfaces](../types/interfaces.md) +- [Classes](../types/classes.md) +- [Structs](../../language-reference/builtin-types/struct.md) +- [Namespaces](namespaces.md) +- [Interfaces](../types/interfaces.md) - [Enums](../../language-reference/builtin-types/enum.md) - [Delegates](../../delegates-overview.md) - -## C# Language Specification + +## C# language specification For more information, see [Basic concepts](~/_csharpstandard/standard/basic-concepts.md) in the [C# Language Specification](~/_csharpstandard/standard/README.md). The language specification is the definitive source for C# syntax and usage. From f5c890989baeabaf03870092b53f6110ce4b93c5 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 4 Mar 2026 16:17:17 -0500 Subject: [PATCH 02/34] Move + revise namespaces.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete `docs/csharp/fundamentals/types/namespaces.md` - Create new `docs/csharp/fundamentals/program-structure/namespaces.md` with heavily revised content covering: - File-scoped namespaces (C# 10) as the *default, recommended* style - Global using directives (C# 10) including implicit usings from the SDK - Static `using` (C# 6) for importing static members - Type and namespace aliases (subset) via `using` alias directive - `extern alias` (brief mention only) - How namespaces organize code and the `.` delimiter convention - Link to SDK section for implicit usings detail - Follow concept → example → concept → example structure - Target 1000–2000 words (5–10 minute read) --- .../program-structure/namespaces.md | 96 +++++++++++++++++++ .../snippets/namespaces/Aliases.cs | 14 +++ .../snippets/namespaces/Basics.cs | 42 ++++++++ .../snippets/namespaces/BlockScoped.cs | 12 +++ .../snippets/namespaces/FileScopedExample.cs | 11 +++ .../snippets/namespaces/GlobalUsings.cs | 4 + .../snippets/namespaces/StaticUsing.cs | 12 +++ .../snippets/namespaces/TupleAlias.cs | 15 +++ .../snippets/namespaces/namespaces.csproj | 10 ++ .../snippets/structure/Program.cs | 47 ++++----- .../snippets/structure/structure.csproj | 2 +- .../snippets/toplevel-structure/Program.cs | 11 +-- .../toplevel-structure.csproj | 2 +- 13 files changed, 238 insertions(+), 40 deletions(-) create mode 100644 docs/csharp/fundamentals/program-structure/namespaces.md create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/Aliases.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/Basics.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/BlockScoped.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/FileScopedExample.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/GlobalUsings.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/StaticUsing.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/TupleAlias.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/namespaces/namespaces.csproj diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md new file mode 100644 index 0000000000000..3046a7a3461b5 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -0,0 +1,96 @@ +--- +title: "Namespaces and using directives" +description: Learn how to organize C# code with namespaces, file-scoped namespace declarations, global usings, static usings, and type aliases. +ms.date: 03/04/2026 +ai-usage: ai-assisted +helpviewer_keywords: + - "C# language, namespaces" + - "namespaces [C#]" + - "using directive [C#]" + - "global using [C#]" + - "file-scoped namespace [C#]" +--- +# Namespaces and using directives + +Namespaces organize C# types into logical groups and prevent naming collisions between types that share the same name. Every .NET type belongs to a namespace—`System.Console`, `System.Collections.Generic.List`, and `System.Threading.Tasks.Task` are all examples. You encounter namespaces constantly, whether you're consuming .NET libraries or organizing your own code. + +The following example shows how namespaces work together with `using` directives in a modern C# file: + +:::code language="csharp" source="snippets/namespaces/Basics.cs" id="NamespaceBasics"::: + +## Using directives + +Without a `using` directive, you must refer to every type by its *fully qualified name*—the complete namespace path plus the type name: + +:::code language="csharp" source="snippets/namespaces/Basics.cs" id="FullyQualifiedName"::: + +A `using` directive at the top of a file imports a namespace so you can use its types by their short names: + +:::code language="csharp" source="snippets/namespaces/Basics.cs" id="UsingDirective"::: + +For more information, see the [`using` directive](../../language-reference/keywords/using-directive.md). + +## File-scoped namespaces + +When you declare your own namespace, use the *file-scoped* syntax (introduced in C# 10). Add a semicolon after the namespace declaration, and it applies to the entire file—no extra braces or indentation needed: + +:::code language="csharp" source="snippets/namespaces/FileScopedExample.cs" id="FileScopedNamespace"::: + +File-scoped namespaces are the recommended style for new code. They reduce nesting and make files easier to read. You can only have one file-scoped namespace declaration per file. + +The older block-scoped syntax wraps all types in braces. This style is still valid but adds an extra level of indentation: + +:::code language="csharp" source="snippets/namespaces/BlockScoped.cs" id="BlockScopedNamespace"::: + +> [!TIP] +> Use file-scoped namespaces in new code. Most .NET templates and code analyzers recommend this style. + +## Global using directives + +If you find yourself writing the same `using` directives in every file, *global using* directives (C# 10) let you declare them once for your entire project. Place them in any file—many teams create a dedicated `GlobalUsings.cs` file: + +:::code language="csharp" source="snippets/namespaces/GlobalUsings.cs" id="GlobalUsings"::: + +After declaring a global using, every file in the project can use types from that namespace without an additional `using` directive. + +### Implicit usings + +The .NET SDK automatically generates global using directives for the most common namespaces based on your project type. Implicit usings are enabled by default when `enable` is set in your project file. For example, a console app project automatically imports `System`, `System.Collections.Generic`, `System.IO`, `System.Linq`, `System.Threading`, and `System.Threading.Tasks`. + +For more information, see [Implicit using directives](../../../core/project-sdk/overview.md#implicit-using-directives). + +## Static using directives + +A `static using` directive (C# 6) imports the static members of a type so you can call them without the type name prefix: + +:::code language="csharp" source="snippets/namespaces/StaticUsing.cs" id="StaticUsing"::: + +Static usings work well for utility classes like and that you call frequently. + +## Type and namespace aliases + +A `using` alias creates a shorthand name for a type or namespace. Aliases are useful for long generic types, resolving naming conflicts, and improving readability: + +:::code language="csharp" source="snippets/namespaces/Aliases.cs" id="TypeAlias"::: + +Beginning with C# 12, you can alias any type, including tuples and pointer types: + +:::code language="csharp" source="snippets/namespaces/TupleAlias.cs" id="AnyTypeAlias"::: + +For more advanced scenarios where two assemblies define the same fully qualified type name, you can use [extern alias](../../language-reference/keywords/extern-alias.md) to disambiguate between them. + +## How namespaces organize code + +Namespaces have these key properties: + +- They organize large code projects into logical groups. +- They use the `.` operator to express hierarchy—for example, `System.Collections.Generic`. +- The `using` directive lets you access types without writing the full namespace path. +- The `global` namespace is the root namespace: `global::System` always refers to the .NET namespace. +- Namespace names must be valid C# [identifier names](../coding-style/identifier-names.md). + +The namespace name typically mirrors the folder structure of your project. For example, types in a `Services/Payments` folder often belong to the `MyApp.Services.Payments` namespace. + +## C# language specification + +For more information, see the [Namespaces](~/_csharpstandard/standard/namespaces.md) section of the [C# language specification](~/_csharpstandard/standard/README.md). diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/Aliases.cs b/docs/csharp/fundamentals/program-structure/snippets/namespaces/Aliases.cs new file mode 100644 index 0000000000000..f37bdbef09d41 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/Aliases.cs @@ -0,0 +1,14 @@ +// +using CustomerList = System.Collections.Generic.List; + +namespace MyApp.Services; + +class CustomerService +{ + public CustomerList GetTopCustomers() + { + CustomerList customers = [new() { Name = "Alice" }, new() { Name = "Bob" }]; + return customers; + } +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/Basics.cs b/docs/csharp/fundamentals/program-structure/snippets/namespaces/Basics.cs new file mode 100644 index 0000000000000..c2d38335bab1f --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/Basics.cs @@ -0,0 +1,42 @@ +// +using System.Globalization; + +namespace MyApp.Services; + +class Greeter +{ + public string Greet(string name) + { + var culture = CultureInfo.CurrentCulture; + return $"Hello, {name}! Culture: {culture.Name}"; + } +} +// + +class Program +{ + // + static void ShowFullyQualified() + { + // Without a using directive, use the fully qualified name: + System.Console.WriteLine("Hello from fully qualified name!"); + } + // + + // + static void ShowShortName() + { + // With 'using System;' (or implicit usings enabled), use the short name: + Console.WriteLine("Hello from short name!"); + } + // + + static void Main() + { + ShowFullyQualified(); + ShowShortName(); + + var greeter = new Greeter(); + Console.WriteLine(greeter.Greet("World")); + } +} diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/BlockScoped.cs b/docs/csharp/fundamentals/program-structure/snippets/namespaces/BlockScoped.cs new file mode 100644 index 0000000000000..7fabf6c993cee --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/BlockScoped.cs @@ -0,0 +1,12 @@ +// +namespace MyApp.Models +{ + class Product + { + public required string Name { get; init; } + public decimal Price { get; init; } + + public override string ToString() => $"{Name}: {Price:C}"; + } +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/FileScopedExample.cs b/docs/csharp/fundamentals/program-structure/snippets/namespaces/FileScopedExample.cs new file mode 100644 index 0000000000000..3488c1aa4dd73 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/FileScopedExample.cs @@ -0,0 +1,11 @@ +// +namespace MyApp.Models; + +class Customer +{ + public required string Name { get; init; } + public string? Email { get; init; } + + public override string ToString() => $"{Name} ({Email ?? "no email"})"; +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/GlobalUsings.cs b/docs/csharp/fundamentals/program-structure/snippets/namespaces/GlobalUsings.cs new file mode 100644 index 0000000000000..2308ad90f0239 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/GlobalUsings.cs @@ -0,0 +1,4 @@ +// +global using System.Text; +global using System.Text.Json; +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/StaticUsing.cs b/docs/csharp/fundamentals/program-structure/snippets/namespaces/StaticUsing.cs new file mode 100644 index 0000000000000..0018dc389308e --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/StaticUsing.cs @@ -0,0 +1,12 @@ +// +using static System.Math; + +namespace MyApp.Utilities; + +class CircleCalculator +{ + public static double CalculateArea(double radius) => PI * Pow(radius, 2); + + public static double CalculateCircumference(double radius) => 2 * PI * radius; +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/TupleAlias.cs b/docs/csharp/fundamentals/program-structure/snippets/namespaces/TupleAlias.cs new file mode 100644 index 0000000000000..6af3b74b574f6 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/TupleAlias.cs @@ -0,0 +1,15 @@ +// +using Point = (double X, double Y); + +namespace MyApp.Geometry; + +class Shape +{ + public static double Distance(Point a, Point b) + { + var dx = a.X - b.X; + var dy = a.Y - b.Y; + return Math.Sqrt(dx * dx + dy * dy); + } +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/namespaces/namespaces.csproj b/docs/csharp/fundamentals/program-structure/snippets/namespaces/namespaces.csproj new file mode 100644 index 0000000000000..0ece068f6df1a --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/namespaces/namespaces.csproj @@ -0,0 +1,10 @@ + + + + Exe + net10.0 + enable + enable + + + diff --git a/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs index d59cd3f808519..c633595993c31 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs +++ b/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs @@ -1,37 +1,28 @@ -// A skeleton of a C# program -using System; -namespace YourNamespace -{ - class YourClass - { - } +// A skeleton of a C# program using an explicit Main method +namespace YourNamespace; - struct YourStruct - { - } +class YourClass +{ +} - interface IYourInterface - { - } +struct YourStruct +{ +} - delegate int YourDelegate(); +interface IYourInterface +{ +} - enum YourEnum - { - } +delegate int YourDelegate(); - namespace YourNestedNamespace - { - struct YourStruct - { - } - } +enum YourEnum +{ +} - class Program +class Program +{ + static void Main(string[] args) { - static void Main(string[] args) - { - Console.WriteLine("Hello world!"); - } + Console.WriteLine("Hello, World!"); } } diff --git a/docs/csharp/fundamentals/program-structure/snippets/structure/structure.csproj b/docs/csharp/fundamentals/program-structure/snippets/structure/structure.csproj index f704bf4988fa6..0ece068f6df1a 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/structure/structure.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/structure/structure.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable diff --git a/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/Program.cs index 22db26f9b83ea..f61119dd5bf2a 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/Program.cs +++ b/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/Program.cs @@ -1,6 +1,4 @@ -using System; - -Console.WriteLine("Hello world!"); +Console.WriteLine("Hello, World!"); namespace YourNamespace { @@ -21,11 +19,4 @@ interface IYourInterface enum YourEnum { } - - namespace YourNestedNamespace - { - struct YourStruct - { - } - } } diff --git a/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/toplevel-structure.csproj b/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/toplevel-structure.csproj index 029d5f304b855..f92eec29f31f0 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/toplevel-structure.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/toplevel-structure/toplevel-structure.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable toplevel_structure From dce22f79ccd732721f421672b13ecbe67ce1ec5c Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 4 Mar 2026 16:31:28 -0500 Subject: [PATCH 03/34] Move + modernize namespace snippets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3. **Move + modernize** namespace snippets from `types/snippets/namespaces/` → `program-structure/snippets/namespaces/` - Move all files from `docs/csharp/fundamentals/types/snippets/namespaces/` to `docs/csharp/fundamentals/program-structure/snippets/namespaces/` - Rename snippet region IDs from legacy numeric (`Snippet1`, `Snippet22`, `Snippet23`, `Snippet6`) to CamelCase names (e.g., `FullyQualifiedName`, `UsingDirective`, `ConsoleShorthand`, `DeclareNamespace`, `FileScopedNamespace`) - Modernize code: update `.csproj` target from `net8.0` to latest .NET, use top-level statements or file-based style where appropriate, use everyday C# features (nullable enable, collection expressions if natural) - Add new snippet files for global usings, static using, and alias examples - Delete the old `types/snippets/namespaces/` directory --- docs/csharp/fundamentals/types/namespaces.md | 51 ------------------- .../types/snippets/namespaces/Program.cs | 35 ------------- .../namespaces/filescopednamespace.cs | 11 ---- .../snippets/namespaces/namespaces.csproj | 9 ---- 4 files changed, 106 deletions(-) delete mode 100644 docs/csharp/fundamentals/types/namespaces.md delete mode 100644 docs/csharp/fundamentals/types/snippets/namespaces/Program.cs delete mode 100644 docs/csharp/fundamentals/types/snippets/namespaces/filescopednamespace.cs delete mode 100644 docs/csharp/fundamentals/types/snippets/namespaces/namespaces.csproj diff --git a/docs/csharp/fundamentals/types/namespaces.md b/docs/csharp/fundamentals/types/namespaces.md deleted file mode 100644 index 3300b2a2a6057..0000000000000 --- a/docs/csharp/fundamentals/types/namespaces.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: "Organizing types in namespaces" -description: Learn how namespaces help you organize related types. -ms.date: 11/24/2024 -helpviewer_keywords: - - "C# language, namespaces" - - "namespaces [C#]" ---- -# Declare namespaces to organize types - -Namespaces are heavily used in C# programming in two ways. First, .NET uses namespaces to organize its many classes, as follows: - -:::code language="csharp" source="snippets/namespaces/Program.cs" ID="Snippet22"::: - - is a namespace and is a class in that namespace. The `using` keyword can be used so that the complete name isn't required, as in the following example: - -:::code language="csharp" source="snippets/namespaces/Program.cs" ID="Snippet1"::: - -:::code language="csharp" source="snippets/namespaces/Program.cs" ID="Snippet23"::: - -For more information, see the [using directive](../../language-reference/keywords/using-directive.md). - -You can also create an **alias** for a namespace or type using the [using alias directive](../../language-reference/keywords/using-directive.md#the-using-alias). -In more advanced scenarios, you can reference multiple assemblies with the same namespaces or types by using the [extern alias](../../language-reference/keywords/extern-alias.md) feature. - -[!INCLUDE [csharp10-templates](../../../../includes/csharp10-templates.md)] - -Second, declaring your own namespaces can help you control the scope of class and method names in larger programming projects. Use the [namespace](../../language-reference/keywords/namespace.md) keyword to declare a namespace, as in the following example: - -:::code language="csharp" source="snippets/namespaces/Program.cs" ID="Snippet6"::: - -The name of the namespace must be a valid C# [identifier name](../coding-style/identifier-names.md). - -You can declare a namespace for all types defined in that file, as shown in the following example: - -:::code language="csharp" source="snippets/namespaces/filescopednamespace.cs"::: - -The advantage of this new syntax is that it's simpler, saving horizontal space and braces. That makes your code easier to read. - -## Namespaces overview - -Namespaces have the following properties: - -- They organize large code projects. -- They're delimited by using the `.` operator. -- The `using` directive obviates the requirement to specify the name of the namespace for every class. -- The `global` namespace is the "root" namespace: `global::System` always refers to the .NET namespace. - -## C# language specification - -For more information, see the [Namespaces](~/_csharpstandard/standard/namespaces.md) section of the [C# language specification](~/_csharpstandard/standard/README.md). diff --git a/docs/csharp/fundamentals/types/snippets/namespaces/Program.cs b/docs/csharp/fundamentals/types/snippets/namespaces/Program.cs deleted file mode 100644 index 4d5825017c087..0000000000000 --- a/docs/csharp/fundamentals/types/snippets/namespaces/Program.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -using System; -// - -namespace namespaces -{ - class Program - { - static void Main(string[] args) - { - // - System.Console.WriteLine("Hello World!"); - // - - // - Console.WriteLine("Hello World!"); - // - } - } -} - -// -namespace SampleNamespace -{ - class SampleClass - { - public void SampleMethod() - { - System.Console.WriteLine( - "SampleMethod inside SampleNamespace"); - } - } -} -// - diff --git a/docs/csharp/fundamentals/types/snippets/namespaces/filescopednamespace.cs b/docs/csharp/fundamentals/types/snippets/namespaces/filescopednamespace.cs deleted file mode 100644 index 38abdbeab7d4a..0000000000000 --- a/docs/csharp/fundamentals/types/snippets/namespaces/filescopednamespace.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace SampleNamespace; - -class AnotherSampleClass -{ - public void AnotherSampleMethod() - { - System.Console.WriteLine( - "SampleMethod inside SampleNamespace"); - } -} - diff --git a/docs/csharp/fundamentals/types/snippets/namespaces/namespaces.csproj b/docs/csharp/fundamentals/types/snippets/namespaces/namespaces.csproj deleted file mode 100644 index af31fefa23aa5..0000000000000 --- a/docs/csharp/fundamentals/types/snippets/namespaces/namespaces.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - Exe - net8.0 - enable - - - From 1cbb2ae99a00519705d831e587326d44040ff8f4 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 4 Mar 2026 16:40:02 -0500 Subject: [PATCH 04/34] Create new preprocessor-directives.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 4. **Create** new `docs/csharp/fundamentals/program-structure/preprocessor-directives.md` - This is a *fundamentals-level* article (not the language-reference exhaustive docs at `language-reference/preprocessor-directives.md`) - Cover only the four directives most relevant to everyday development: - `#if` / `#elif` / `#else` / `#endif` — conditional compilation (with `DEBUG`, `RELEASE`, target framework symbols) - `#region` / `#endregion` — code organization - `#nullable enable/disable/restore` — controlling nullable analysis scope - `#pragma warning disable/restore` — suppressing specific warnings - Brief mention of `#!` and `#:` for file-based apps (C# 14) with cross-reference to the overview and language reference - Link to the full `language-reference/preprocessor-directives.md` for complete reference - Create snippet project at `program-structure/snippets/preprocessor-directives/` - Add `ai-usage: ai-assisted` to frontmatter --- .../preprocessor-directives.md | 79 +++++++++++++++++++ .../NullableContext.cs | 19 +++++ .../preprocessor-directives/PragmaWarning.cs | 23 ++++++ .../preprocessor-directives/Program.cs | 26 ++++++ .../preprocessor-directives/Regions.cs | 22 ++++++ .../preprocessor-directives.csproj | 10 +++ 6 files changed, 179 insertions(+) create mode 100644 docs/csharp/fundamentals/program-structure/preprocessor-directives.md create mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/PragmaWarning.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Program.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/preprocessor-directives.csproj diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md new file mode 100644 index 0000000000000..665d2a35ec5de --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -0,0 +1,79 @@ +--- +title: "Preprocessor directives" +description: Learn how to use the most common C# preprocessor directives—conditional compilation, regions, nullable context control, and warning suppression—in everyday development. +ms.date: 03/04/2026 +ai-usage: ai-assisted +helpviewer_keywords: + - "preprocessor directives [C#]" + - "#if directive [C#]" + - "#region directive [C#]" + - "#nullable directive [C#]" + - "#pragma warning [C#]" +--- +# Preprocessor directives + +C# preprocessor directives are instructions to the compiler that affect compilation without changing your program's run-time behavior. They always start with `#` and must be the only instruction on a line. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, four groups cover the vast majority of everyday use: + +- **Conditional compilation** (`#if` / `#elif` / `#else` / `#endif`) — include or exclude code based on build configuration or target framework. +- **Regions** (`#region` / `#endregion`) — mark collapsible sections in your editor. +- **Nullable context** (`#nullable`) — control nullable reference type analysis at a fine-grained level. +- **Warning suppression** (`#pragma warning`) — suppress or restore specific compiler warnings. + +## Conditional compilation + +Use `#if`, `#elif`, `#else`, and `#endif` to include or exclude code based on whether a symbol is defined. The most common symbols are `DEBUG` (set automatically for Debug builds) and target framework symbols like `NET10_0_OR_GREATER`: + +:::code language="csharp" source="snippets/preprocessor-directives/Program.cs" id="ConditionalCompilation"::: + +The `DEBUG` symbol is defined when you build in the Debug configuration. You don't need to define it yourself—the build system handles it. Target framework symbols like `NET10_0_OR_GREATER` and `NET8_0_OR_GREATER` let you write code that adapts to different .NET versions in multi-targeting projects. + +You can combine symbols with logical operators—`&&` (and), `||` (or), and `!` (not): + +:::code language="csharp" source="snippets/preprocessor-directives/Program.cs" id="CombinedConditions"::: + +Use `#define` at the top of a file to define your own symbols. You can also define symbols project-wide with the `DefineConstants` property in your project file. + +## Regions + +Use `#region` and `#endregion` to mark collapsible sections of code in your editor. Regions don't affect compilation—they're purely an organizational tool: + +:::code language="csharp" source="snippets/preprocessor-directives/Regions.cs" id="RegionExample"::: + +Regions are helpful in longer files to group related members. Many teams use them to separate fields, properties, constructors, and methods. + +## Nullable context + +The `#nullable` directive controls nullable reference type analysis within a file. While you typically enable nullable analysis project-wide in your `.csproj` file with `enable`, the `#nullable` directive lets you fine-tune the setting for specific sections of code: + +:::code language="csharp" source="snippets/preprocessor-directives/NullableContext.cs" id="NullableDirective"::: + +The three forms are: + +- `#nullable enable` — turn on nullable warnings and annotations. +- `#nullable disable` — turn off nullable warnings and annotations. +- `#nullable restore` — revert to the project-level setting. + +This directive is especially useful when you're incrementally migrating a large codebase to nullable reference types. Enable it file by file or section by section, fixing warnings as you go. + +## Warning suppression + +Use `#pragma warning disable` to suppress specific compiler warnings, and `#pragma warning restore` to re-enable them. Always scope the suppression as narrowly as possible: + +:::code language="csharp" source="snippets/preprocessor-directives/PragmaWarning.cs" id="PragmaWarning"::: + +> [!TIP] +> Always specify the warning number (like `CS0168`) rather than disabling all warnings. This keeps the suppression targeted and makes it clear *why* a warning is being suppressed. + +## File-based app directives + +Beginning with C# 14, [file-based apps](index.md) use two additional directives: + +- `#!` — the *shebang* line that lets Unix shells run the file directly (for example, `#!/usr/bin/env dotnet run`). +- `#:` — build-system directives that configure packages, SDK settings, and other options for single-file programs. + +For details on these directives, see [File-based apps](../../../core/sdk/file-based-apps.md) and the [language reference](../../language-reference/preprocessor-directives.md#file-based-apps). + +## See also + +- [C# preprocessor directives (language reference)](../../language-reference/preprocessor-directives.md) — complete reference for all preprocessor directives. +- [Nullable reference types](../../nullable-references.md) — learn about the nullable reference type system. diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs new file mode 100644 index 0000000000000..441dedfa9e032 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs @@ -0,0 +1,19 @@ +namespace MyApp.Data; + +// +#nullable enable +class CustomerRepository +{ + // With #nullable enable, the compiler warns if you return null + // without declaring the return type as nullable: + public string? FindCustomerName(int id) + { + if (id == 1) + { + return "Alice"; + } + return null; // No warning — return type is string? + } +} +#nullable restore +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/PragmaWarning.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/PragmaWarning.cs new file mode 100644 index 0000000000000..b5a5dfa5ed741 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/PragmaWarning.cs @@ -0,0 +1,23 @@ +namespace MyApp.Utilities; + +class WarningDemo +{ + // + static void ProcessData() + { + try + { + // Some operation that might fail + var data = File.ReadAllText("config.json"); + Console.WriteLine($"Config loaded: {data.Length} characters"); + } +#pragma warning disable CS0168 // Variable is declared but never used + catch (FileNotFoundException ex) +#pragma warning restore CS0168 + { + // Fall back to defaults — the exception details aren't needed here + Console.WriteLine("Config file not found, using defaults."); + } + } + // +} diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Program.cs new file mode 100644 index 0000000000000..ee5e9227a1443 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Program.cs @@ -0,0 +1,26 @@ +// +static void ConfigureLogging() +{ +#if DEBUG + Console.WriteLine("Debug logging enabled — verbose output active."); +#else + Console.WriteLine("Release logging — errors only."); +#endif +} +// + +// +static void ShowPlatformInfo() +{ +#if NET10_0_OR_GREATER + Console.WriteLine("Running on .NET 10 or later."); +#elif NET8_0_OR_GREATER + Console.WriteLine("Running on .NET 8 or 9."); +#else + Console.WriteLine("Running on an older .NET version."); +#endif +} +// + +ConfigureLogging(); +ShowPlatformInfo(); diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs new file mode 100644 index 0000000000000..7da1e8a59fa62 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs @@ -0,0 +1,22 @@ +namespace MyApp.Services; + +class ValidationAndFormatting +{ + // + #region Validation methods + static bool IsValidEmail(string email) => + email.Contains('@') && email.Contains('.'); + + static bool IsValidAge(int age) => + age is > 0 and < 150; + #endregion + + #region Formatting methods + static string FormatName(string first, string last) => + $"{last}, {first}"; + + static string FormatCurrency(decimal amount) => + amount.ToString("C"); + #endregion + // +} diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/preprocessor-directives.csproj b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/preprocessor-directives.csproj new file mode 100644 index 0000000000000..0ece068f6df1a --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/preprocessor-directives.csproj @@ -0,0 +1,10 @@ + + + + Exe + net10.0 + enable + enable + + + From 920840e0fac4580dccef5edc3940b52b4595730f Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 4 Mar 2026 16:51:13 -0500 Subject: [PATCH 05/34] Create organizing-programs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5. **Create** new `docs/csharp/fundamentals/program-structure/organizing-programs.md` - Addresses [dotnet/docs#34836](https://github.com/dotnet/docs/issues/34836) - Content: assemblies, namespaces, and types as organizational tools - Cover how the organizational hierarchy works: solution → projects → assemblies → namespaces → types - Explain naming conventions and how folder structure typically mirrors namespace structure - Show practical examples of organizing a small multi-project solution - Create snippet project at `program-structure/snippets/organizing-programs/` - Add `ai-usage: ai-assisted` to frontmatter --- .openpublishing.redirection.csharp.json | 4218 +++++++++-------- .../program-structure/organizing-programs.md | 90 + .../snippets/organizing-programs/AppDemo.cs | 12 + .../snippets/organizing-programs/Inventory.cs | 23 + .../organizing-programs/OrderService.cs | 16 + .../snippets/organizing-programs/Payments.cs | 20 + .../snippets/organizing-programs/Program.cs | 13 + .../organizing-programs.csproj | 11 + .../language-reference/keywords/namespace.md | 2 +- .../keywords/using-directive.md | 2 +- docs/csharp/misc/cs0101.md | 2 +- docs/csharp/misc/cs1527.md | 2 +- docs/csharp/toc.yml | 8 +- 13 files changed, 2306 insertions(+), 2113 deletions(-) create mode 100644 docs/csharp/fundamentals/program-structure/organizing-programs.md create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Inventory.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/OrderService.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Payments.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/organizing-programs.csproj diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index c7a967aaf4a6a..84cd4bf1fc0f8 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -1,2874 +1,2878 @@ { - "redirections": [ + "redirections": [ + { + "source_path_from_root": "/docs/csharp/fundamentals/types/namespaces.md", + "redirect_url": "/dotnet/csharp/fundamentals/program-structure/namespaces" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0080.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0081.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0305.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0306.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0307.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0308.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0312.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0313.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0314.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0315.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0401.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0403.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0405.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, { - "source_path_from_root": "/docs/csharp/misc/cs0080.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/misc/cs0407.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs0412.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0449.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0450.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0451.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0454.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0455.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0694.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0695.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0698.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0706.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0717.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0104.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0104" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0434.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0434" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0435.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0435" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0436.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0436" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0437.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0437" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0438.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0438" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1022.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs1022" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0304.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0310.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0311.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0413.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0417.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, { - "source_path_from_root": "/docs/csharp/misc/cs0081.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0467.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0702.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0703.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/binary-literals.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/lexical-structure#6453-integer-literals" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/digit-separators.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/lexical-structure#6453-integer-literals" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/local-functions.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/statements#1364-local-function-declarations" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/throw-expression.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1215-the-throw-expression-operator" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/out-var.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1217-declaration-expressions" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/pattern-matching.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/patterns" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/task-types.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#15152-task-type-builder-pattern" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.1/async-main.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/basic-concepts#71-application-startup" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.1/target-typed-default.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12719-default-value-expressions" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.1/infer-tuple-names.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#8311-tuple-types" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.1/generics-pattern-match.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/patterns" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.2/conditional-ref.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1219-conditional-operator" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.2/non-trailing-named-arguments.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12621-general" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.2/private-protected.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1536-access-modifiers" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.2/readonly-ref.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#97-reference-variables-and-returns" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.2/readonly-struct.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/structs#1624-struct-interfaces" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.2/span-safety.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#97-reference-variables-and-returns" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/auto-prop-field-attrs.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/attributes#223-attribute-specification" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/blittable.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1525-type-parameter-constraints" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/expression-variables-in-initializers.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1217-declaration-expressions" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/improved-overload-candidates.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12642-applicable-function-member" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/indexing-movable-fixed-fields.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#2383-fixed-size-buffers-in-expressions" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/leading-digit-separator.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/lexical-structure#6453-integer-literals" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#247-the-fixed-statement" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/ref-local-reassignment.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#97-reference-variables-and-returns" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/stackalloc-array-initializers.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12821-stack-allocation" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/tuple-equality.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#121211-tuple-equality-operators" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-9.0/nullable-reference-types-specification.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md", + "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/generic-attributes" + }, + { + "source_path_from_root": "/docs/csharp/async.md", + "redirect_url": "/dotnet/csharp/asynchronous-programming" + }, + { + "source_path_from_root": "/docs/csharp/basic-types.md", + "redirect_url": "/dotnet/csharp/fundamentals/types" + }, + { + "source_path_from_root": "/docs/csharp/classes.md", + "redirect_url": "/dotnet/csharp/fundamentals/types/classes" + }, + { + "source_path_from_root": "/docs/csharp/codedoc.md", + "redirect_url": "/dotnet/csharp/language-reference/xmldoc/recommended-tags" + }, + { + "source_path_from_root": "/docs/csharp/csharp-6.md", + "redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-60" + }, + { + "source_path_from_root": "/docs/csharp/csharp-7.md", + "redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-70" + }, + { + "source_path_from_root": "/docs/csharp/csharp.md", + "redirect_url": "/dotnet/csharp" + }, + { + "source_path_from_root": "/docs/csharp/deconstruct.md", + "redirect_url": "/dotnet/csharp/fundamentals/functional/deconstruct" + }, + { + "source_path_from_root": "/docs/csharp/delegates-events.md", + "redirect_url": "/dotnet/csharp/delegates-overview" + }, + { + "source_path_from_root": "/docs/csharp/discards.md", + "redirect_url": "/dotnet/csharp/fundamentals/functional/discards" + }, + { + "source_path_from_root": "/docs/csharp/expression-trees.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees" + }, + { + "source_path_from_root": "/docs/csharp/expression-classes.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-classes" + }, + { + "source_path_from_root": "/docs/csharp/expression-trees-building.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-building" + }, + { + "source_path_from_root": "/docs/csharp/expression-trees-explained.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-explained" + }, + { + "source_path_from_root": "/docs/csharp/expression-trees-execution.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-execution" + }, + { + "source_path_from_root": "/docs/csharp/expression-trees-interpreting.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-interpreting" + }, + { + "source_path_from_root": "/docs/csharp/expression-trees-summary.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees" + }, + { + "source_path_from_root": "/docs/csharp/expression-trees-translating.md", + "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-translating" + }, + { + "source_path_from_root": "/docs/csharp/features.md", + "redirect_url": "/dotnet/csharp/programming-guide/concepts" + }, + { + "source_path_from_root": "/docs/csharp/generics.md", + "redirect_url": "/dotnet/csharp/fundamentals/types/generics" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/additional-resources.md", + "redirect_url": "/dotnet/csharp/tour-of-csharp" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/breaking-changes-in-visual-studio-2013.md", + "redirect_url": "/previous-versions/visualstudio/visual-studio-2013/hh678682(v=vs.120)" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/consuming-library-with-visual-studio-2017.md", + "redirect_url": "/nuget/quickstart/install-and-use-a-package-in-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/consuming-library-with-visual-studio.md", + "redirect_url": "/nuget/quickstart/install-and-use-a-package-in-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/debugging-with-visual-studio-2017.md", + "redirect_url": "/dotnet/core/tutorials/debugging-with-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/debugging-with-visual-studio.md", + "redirect_url": "/dotnet/core/tutorials/debugging-with-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/getting-started-with-csharp.md", + "redirect_url": "/dotnet/csharp/tour-of-csharp" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/index.md", + "redirect_url": "/dotnet/csharp/tour-of-csharp" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/library-with-visual-studio-2017.md", + "redirect_url": "/dotnet/core/tutorials/library-with-visual-studio", + "redirect_document_id": true + }, + { + "source_path_from_root": "/docs/csharp/getting-started/library-with-visual-studio.md", + "redirect_url": "/dotnet/core/tutorials/library-with-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/publishing-with-visual-studio-2017.md", + "redirect_url": "/dotnet/core/tutorials/publishing-with-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/publishing-with-visual-studio.md", + "redirect_url": "/dotnet/core/tutorials/publishing-with-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/testing-library-with-visual-studio.md", + "redirect_url": "/dotnet/core/tutorials/testing-library-with-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/getting-started/with-visual-studio-2017.md", + "redirect_url": "/dotnet/core/tutorials/with-visual-studio", + "redirect_document_id": true + }, + { + "source_path_from_root": "/docs/csharp/getting-started/with-visual-studio-code.md", + "redirect_url": "/dotnet/core/tutorials/with-visual-studio-code", + "redirect_document_id": true + }, + { + "source_path_from_root": "/docs/csharp/getting-started/with-visual-studio.md", + "redirect_url": "/dotnet/core/tutorials/with-visual-studio" + }, + { + "source_path_from_root": "/docs/csharp/how-to/safely-cast-using-pattern-matching-is-and-as-operators.md", + "redirect_url": "/dotnet/csharp/fundamentals/tutorials/safely-cast-using-pattern-matching-is-and-as-operators" + }, + { + "source_path_from_root": "/docs/csharp/implicitly-typed-lambda-expressions.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/lambda-expressions" + }, + { + "source_path_from_root": "/docs/csharp/indexers.md", + "redirect_url": "/dotnet/csharp/programming-guide/indexers" + }, + { + "source_path_from_root": "/docs/csharp/interactive-with-bash.md", + "redirect_url": "/dotnet/csharp/index" + }, + { + "source_path_from_root": "/docs/csharp/interactive-with-powershell.md", + "redirect_url": "/dotnet/csharp/index" + }, + { + "source_path_from_root": "/docs/csharp/interactive-with-visualstudio.md", + "redirect_url": "/dotnet/csharp/index" + }, + { + "source_path_from_root": "/docs/csharp/interactive.md", + "redirect_url": "/dotnet/csharp/index" + }, + { + "source_path_from_root": "/docs/csharp/interfaces.md", + "redirect_url": "/dotnet/csharp/fundamentals/types/interfaces" + }, + { + "source_path_from_root": "/docs/csharp/interop.md", + "redirect_url": "/dotnet/csharp/advanced-topics/interop/index" + }, + { + "source_path_from_root": "/docs/csharp/lambda-expressions.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/lambda-expressions" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/builtin-types/nint-nuint.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#native-sized-integers" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0034.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0071.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0106.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0116.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0116" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0277.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0178.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0181.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0188.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0233.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0234.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0246.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0260.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0270.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0518.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0518" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0545.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0552.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0563.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0571.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0579.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0592.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0616.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0650.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0686.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0736.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0737.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0738.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0767.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0826.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0834.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0840.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0843.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0845.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0846.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0854.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1009.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1018.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1019.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1029.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1063.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, { - "source_path_from_root": "/docs/csharp/misc/cs0305.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1065.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0306.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1067.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0307.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1112.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs0308.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1501.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" }, { - "source_path_from_root": "/docs/csharp/misc/cs0312.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1502.md", + "redirect_url": "/dotnet/csharp/misc/cs1503" }, { - "source_path_from_root": "/docs/csharp/misc/cs0313.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1614.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0314.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1656.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0315.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1683.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" }, { - "source_path_from_root": "/docs/csharp/misc/cs0401.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1708.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0403.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1716.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0405.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1919.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0407.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1691.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0412.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1704.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" }, { - "source_path_from_root": "/docs/csharp/misc/cs0449.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1739.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" }, { - "source_path_from_root": "/docs/csharp/misc/cs0450.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1740.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" }, { - "source_path_from_root": "/docs/csharp/misc/cs0451.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1741.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0454.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1742.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" }, { - "source_path_from_root": "/docs/csharp/misc/cs0455.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1751.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" }, { - "source_path_from_root": "/docs/csharp/misc/cs0694.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1921.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0695.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1946.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" }, { - "source_path_from_root": "/docs/csharp/misc/cs0698.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1983.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0706.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1986.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0717.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1994.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0104.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0104" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1996.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0434.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0434" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1997.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0435.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0435" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1988.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0436.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0436" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4004.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0437.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0437" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4008.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs0438.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0438" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4014.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1022.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs1022" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4032.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0304.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4033.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0310.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/misc/CS4009.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0311.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs3007.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0413.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4013.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0417.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs7000.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0467.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8145.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0702.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8153.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#conversion-to-expression-trees" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0703.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/generic-type-parameters-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8154.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.0/binary-literals.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/lexical-structure#6453-integer-literals" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8155.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#conversion-to-expression-trees" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.0/digit-separators.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/lexical-structure#6453-integer-literals" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8166.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.0/local-functions.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/statements#1364-local-function-declarations" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8167.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.0/throw-expression.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1215-the-throw-expression-operator" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8168.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.0/out-var.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1217-declaration-expressions" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8169.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.0/pattern-matching.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/patterns" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8175.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.0/task-types.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#15152-task-type-builder-pattern" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8176.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.1/async-main.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/basic-concepts#71-application-startup" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8177.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.1/target-typed-default.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12719-default-value-expressions" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8178.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.1/infer-tuple-names.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#8311-tuple-types" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8373.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.1/generics-pattern-match.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/patterns" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8374.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.2/conditional-ref.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1219-conditional-operator" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8400.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.2/non-trailing-named-arguments.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12621-general" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8401.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.2/private-protected.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1536-access-modifiers" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8403.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.2/readonly-ref.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#97-reference-variables-and-returns" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8410.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.2/readonly-struct.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/structs#1624-struct-interfaces" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8411.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.2/span-safety.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#97-reference-variables-and-returns" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8417.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/auto-prop-field-attrs.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/attributes#223-attribute-specification" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8418.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/blittable.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1525-type-parameter-constraints" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8647.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/expression-variables-in-initializers.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1217-declaration-expressions" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8648.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/improved-overload-candidates.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12642-applicable-function-member" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8649.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/indexing-movable-fixed-fields.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#2383-fixed-size-buffers-in-expressions" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8795.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/leading-digit-separator.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/lexical-structure#6453-integer-literals" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8812.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#247-the-fixed-statement" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8817.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/ref-local-reassignment.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#97-reference-variables-and-returns" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8892.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/warning-waves#cs8892" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/stackalloc-array-initializers.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#12821-stack-allocation" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8964.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/tuple-equality.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#121211-tuple-equality-operators" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs9036.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-9.0/nullable-reference-types-specification.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs9050.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-struct-errors" }, { - "source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md", - "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/generic-attributes" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/addmodule-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/inputs" }, { - "source_path_from_root": "/docs/csharp/async.md", - "redirect_url": "/dotnet/csharp/asynchronous-programming" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/app-deployment.md", + "redirect_url": "/dotnet/framework/deployment/deployment-guide-for-developers" }, { - "source_path_from_root": "/docs/csharp/basic-types.md", - "redirect_url": "/dotnet/csharp/fundamentals/types" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/appconfig-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/classes.md", - "redirect_url": "/dotnet/csharp/fundamentals/types/classes" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/baseaddress-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/codedoc.md", - "redirect_url": "/dotnet/csharp/language-reference/xmldoc/recommended-tags" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/bugreport-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options" }, { - "source_path_from_root": "/docs/csharp/csharp-6.md", - "redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-60" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/checked-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" }, { - "source_path_from_root": "/docs/csharp/csharp-7.md", - "redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-70" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/codepage-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/csharp.md", - "redirect_url": "/dotnet/csharp" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/command-line-building-with-csc-exe.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options" }, { - "source_path_from_root": "/docs/csharp/deconstruct.md", - "redirect_url": "/dotnet/csharp/fundamentals/functional/deconstruct" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/debug-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" }, { - "source_path_from_root": "/docs/csharp/delegates-events.md", - "redirect_url": "/dotnet/csharp/delegates-overview" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/define-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" }, { - "source_path_from_root": "/docs/csharp/discards.md", - "redirect_url": "/dotnet/csharp/fundamentals/functional/discards" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/delaysign-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" }, { - "source_path_from_root": "/docs/csharp/expression-trees.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/deterministic-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" }, { - "source_path_from_root": "/docs/csharp/expression-classes.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-classes" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/doc-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/expression-trees-building.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-building" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/errorreport-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options" }, { - "source_path_from_root": "/docs/csharp/expression-trees-explained.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-explained" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/filealign-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/expression-trees-execution.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-execution" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/fullpaths-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/expression-trees-interpreting.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-interpreting" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/help-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" }, { - "source_path_from_root": "/docs/csharp/expression-trees-summary.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/highentropyva-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" }, { - "source_path_from_root": "/docs/csharp/expression-trees-translating.md", - "redirect_url": "/dotnet/csharp/advanced-topics/expression-trees/expression-trees-translating" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/how-to-set-environment-variables-for-the-visual-studio-command-line.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options" }, { - "source_path_from_root": "/docs/csharp/features.md", - "redirect_url": "/dotnet/csharp/programming-guide/concepts" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/keycontainer-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" }, { - "source_path_from_root": "/docs/csharp/generics.md", - "redirect_url": "/dotnet/csharp/fundamentals/types/generics" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/keyfile-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" }, { - "source_path_from_root": "/docs/csharp/getting-started/additional-resources.md", - "redirect_url": "/dotnet/csharp/tour-of-csharp" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/langversion-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" }, { - "source_path_from_root": "/docs/csharp/getting-started/breaking-changes-in-visual-studio-2013.md", - "redirect_url": "/previous-versions/visualstudio/visual-studio-2013/hh678682(v=vs.120)" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/lib-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/getting-started/consuming-library-with-visual-studio-2017.md", - "redirect_url": "/nuget/quickstart/install-and-use-a-package-in-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/link-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/inputs" }, { - "source_path_from_root": "/docs/csharp/getting-started/consuming-library-with-visual-studio.md", - "redirect_url": "/nuget/quickstart/install-and-use-a-package-in-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/linkresource-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" }, { - "source_path_from_root": "/docs/csharp/getting-started/debugging-with-visual-studio-2017.md", - "redirect_url": "/dotnet/core/tutorials/debugging-with-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/listed-alphabetically.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options" }, { - "source_path_from_root": "/docs/csharp/getting-started/debugging-with-visual-studio.md", - "redirect_url": "/dotnet/core/tutorials/debugging-with-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/listed-by-category.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options" }, { - "source_path_from_root": "/docs/csharp/getting-started/getting-started-with-csharp.md", - "redirect_url": "/dotnet/csharp/tour-of-csharp" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/main-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/getting-started/index.md", - "redirect_url": "/dotnet/csharp/tour-of-csharp" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/moduleassemblyname-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/getting-started/library-with-visual-studio-2017.md", - "redirect_url": "/dotnet/core/tutorials/library-with-visual-studio", - "redirect_document_id": true + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/noconfig-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" }, { - "source_path_from_root": "/docs/csharp/getting-started/library-with-visual-studio.md", - "redirect_url": "/dotnet/core/tutorials/library-with-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nologo-file-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" }, { - "source_path_from_root": "/docs/csharp/getting-started/publishing-with-visual-studio-2017.md", - "redirect_url": "/dotnet/core/tutorials/publishing-with-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nostdlib-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/getting-started/publishing-with-visual-studio.md", - "redirect_url": "/dotnet/core/tutorials/publishing-with-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nowarn-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/errors-warnings" }, { - "source_path_from_root": "/docs/csharp/getting-started/testing-library-with-visual-studio.md", - "redirect_url": "/dotnet/core/tutorials/testing-library-with-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nowin32manifest-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" }, { - "source_path_from_root": "/docs/csharp/getting-started/with-visual-studio-2017.md", - "redirect_url": "/dotnet/core/tutorials/with-visual-studio", - "redirect_document_id": true + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nullable-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" }, { - "source_path_from_root": "/docs/csharp/getting-started/with-visual-studio-code.md", - "redirect_url": "/dotnet/core/tutorials/with-visual-studio-code", - "redirect_document_id": true + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/optimize-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" }, { - "source_path_from_root": "/docs/csharp/getting-started/with-visual-studio.md", - "redirect_url": "/dotnet/core/tutorials/with-visual-studio" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/out-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/how-to/safely-cast-using-pattern-matching-is-and-as-operators.md", - "redirect_url": "/dotnet/csharp/fundamentals/tutorials/safely-cast-using-pattern-matching-is-and-as-operators" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/pathmap-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/implicitly-typed-lambda-expressions.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/lambda-expressions" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/pdb-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/indexers.md", - "redirect_url": "/dotnet/csharp/programming-guide/indexers" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/platform-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/interactive-with-bash.md", - "redirect_url": "/dotnet/csharp/index" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/preferreduilang-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/interactive-with-powershell.md", - "redirect_url": "/dotnet/csharp/index" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/publicsign-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" }, { - "source_path_from_root": "/docs/csharp/interactive-with-visualstudio.md", - "redirect_url": "/dotnet/csharp/index" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/recurse-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options" }, { - "source_path_from_root": "/docs/csharp/interactive.md", - "redirect_url": "/dotnet/csharp/index" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/reference-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/inputs" }, { - "source_path_from_root": "/docs/csharp/interfaces.md", - "redirect_url": "/dotnet/csharp/fundamentals/types/interfaces" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/refonly-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" }, { - "source_path_from_root": "/docs/csharp/interop.md", - "redirect_url": "/dotnet/csharp/advanced-topics/interop/index" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/refout-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/lambda-expressions.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/lambda-expressions" - }, + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/resource-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" + }, { - "source_path_from_root": "/docs/csharp/language-reference/builtin-types/nint-nuint.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#native-sized-integers" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/response-file-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0034.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/subsystemversion-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0071.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-appcontainerexe-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0106.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0116.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0116" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-exe-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/misc/cs0277.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-library-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0178.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-module-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0181.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-winexe-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0188.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-winmdobj-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0233.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/unsafe-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0234.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/utf8output-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0246.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/warn-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/errors-warnings" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0260.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/warnaserror-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/errors-warnings" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0270.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/win32icon-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0518.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors#cs0518" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/win32manifest-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0545.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/compiler-options/win32res-compiler-option.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0552.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/access-keywords.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/base" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0563.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/as.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/type-testing-and-cast#the-as-operator" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0571.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/await.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/await" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0579.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/bool.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0592.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/break.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0616.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/built-in-types-table.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/built-in-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0650.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/byte.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0686.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/char.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/char" }, { - "source_path_from_root": "/docs/csharp/misc/cs0736.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/checked.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/checked-and-unchecked" }, { - "source_path_from_root": "/docs/csharp/misc/cs0737.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/checked-and-unchecked.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/checked-and-unchecked" }, { - "source_path_from_root": "/docs/csharp/misc/cs0738.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/continue.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0767.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/contextual-keywords.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/index#contextual-keywords" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0826.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/conversion-keywords.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/user-defined-conversion-operators" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0834.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/keywords/decimal.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0840.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/default-values-table.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/default-values" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0843.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/delegate.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0845.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/keywords/do.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0846.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/double.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0854.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/keywords/dynamic.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1009.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + "source_path_from_root": "/docs/csharp/language-reference/keywords/enum.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/enum" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1018.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + "source_path_from_root": "/docs/csharp/language-reference/keywords/exception-handling-statements.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/statement-keywords" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1019.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + "source_path_from_root": "/docs/csharp/language-reference/keywords/explicit-numeric-conversions-table.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/numeric-conversions" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1029.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/explicit.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/user-defined-conversion-operators" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1063.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/false-literal.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1065.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/false-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/true-false-operators" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1067.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types" + "source_path_from_root": "/docs/csharp/language-reference/keywords/false.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1112.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/language-reference/keywords/fixed-statement.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/fixed" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1501.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + "source_path_from_root": "/docs/csharp/language-reference/keywords/float.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1502.md", - "redirect_url": "/dotnet/csharp/misc/cs1503" + "source_path_from_root": "/docs/csharp/language-reference/keywords/floating-point-types-table.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1614.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/for.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1656.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/foreach-in.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1683.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + "source_path_from_root": "/docs/csharp/language-reference/keywords/formatting-numeric-results-table.md", + "redirect_url": "/dotnet/standard/base-types/standard-numeric-format-strings" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1708.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/global.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/namespace-alias-qualifier" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1716.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/goto.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1919.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/if-else.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/selection-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1691.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/implicit-numeric-conversions-table.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/numeric-conversions" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1704.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + "source_path_from_root": "/docs/csharp/language-reference/keywords/implicit.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/user-defined-conversion-operators" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1739.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/keywords/in-parameter-modifier.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/method-parameters#in-parameter-modifier" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1740.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/keywords/int.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1741.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/integral-types-table.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1742.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/keywords/interpolated-strings.md", + "redirect_url": "/dotnet/csharp/language-reference/tokens/interpolated" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1751.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + "source_path_from_root": "/docs/csharp/language-reference/keywords/is.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/is" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1921.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/iteration-statements.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1946.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/keywords/jump-statements.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/statement-keywords" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1983.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/literal-keywords.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/null" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1986.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/lock-statement.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/lock" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1994.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/long.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1996.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/modifiers.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1997.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/nameof.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/nameof" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1988.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/namespace-keywords.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/namespace" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4004.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/new-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/new-operator" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4008.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/object.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4014.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/operator-keywords.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/index" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4032.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/operator-overloading" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4033.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/out-parameter-modifier.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/method-parameters#out-parameter-modifier" }, { - "source_path_from_root": "/docs/csharp/misc/CS4009.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/params.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/method-parameters#params-modifier" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs3007.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/partial-method.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/partial-member", + "redirect_document_id": true }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs4013.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/language-reference/keywords/reference-tables-for-types.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs7000.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8145.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8153.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#conversion-to-expression-trees" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8154.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8155.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#conversion-to-expression-trees" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8166.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8167.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8168.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8169.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8175.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8176.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8177.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8178.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8373.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8374.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8400.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8401.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8403.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8410.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8411.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/async-await-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8417.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8418.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8647.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8648.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8649.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8795.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8812.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8817.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8892.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/warning-waves#cs8892" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs8964.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs9036.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs9050.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-struct-errors" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/addmodule-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/inputs" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/app-deployment.md", - "redirect_url": "/dotnet/framework/deployment/deployment-guide-for-developers" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/appconfig-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/baseaddress-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/bugreport-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/checked-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/codepage-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/command-line-building-with-csc-exe.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/debug-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/define-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/delaysign-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/deterministic-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/doc-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/errorreport-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/filealign-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/fullpaths-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/help-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/highentropyva-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/how-to-set-environment-variables-for-the-visual-studio-command-line.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/keycontainer-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/keyfile-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/langversion-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/lib-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/link-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/inputs" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/linkresource-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/listed-alphabetically.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/listed-by-category.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/main-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/moduleassemblyname-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/noconfig-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nologo-file-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nostdlib-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nowarn-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/errors-warnings" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nowin32manifest-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/nullable-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/optimize-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/out-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/pathmap-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/pdb-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/platform-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/preferreduilang-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/publicsign-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/security" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/recurse-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/reference-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/inputs" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/refonly-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/code-generation" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/refout-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/resource-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/response-file-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/miscellaneous" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/subsystemversion-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-appcontainerexe-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-exe-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-library-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-module-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-winexe-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/target-winmdobj-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/output" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/unsafe-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/language" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/utf8output-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/advanced" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/warn-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/errors-warnings" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/warnaserror-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/errors-warnings" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/win32icon-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/win32manifest-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/compiler-options/win32res-compiler-option.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-options/resources" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/access-keywords.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/base" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/as.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/type-testing-and-cast#the-as-operator" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/await.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/await" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/bool.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/break.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/built-in-types-table.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/built-in-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/byte.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/char.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/char" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/checked.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/checked-and-unchecked" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/checked-and-unchecked.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/checked-and-unchecked" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/continue.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/contextual-keywords.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/index#contextual-keywords" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/conversion-keywords.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/user-defined-conversion-operators" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/decimal.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/default-values-table.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/default-values" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/delegate.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/do.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/double.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/dynamic.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/enum.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/enum" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/exception-handling-statements.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/statement-keywords" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/explicit-numeric-conversions-table.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/numeric-conversions" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/explicit.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/user-defined-conversion-operators" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/false-literal.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/false-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/true-false-operators" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/false.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/fixed-statement.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/fixed" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/float.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/floating-point-types-table.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/for.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/foreach-in.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/formatting-numeric-results-table.md", - "redirect_url": "/dotnet/standard/base-types/standard-numeric-format-strings" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/global.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/namespace-alias-qualifier" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/goto.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/if-else.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/selection-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/implicit-numeric-conversions-table.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/numeric-conversions" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/implicit.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/user-defined-conversion-operators" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/in-parameter-modifier.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/method-parameters#in-parameter-modifier" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/int.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/integral-types-table.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/interpolated-strings.md", - "redirect_url": "/dotnet/csharp/language-reference/tokens/interpolated" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/is.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/is" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/iteration-statements.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/jump-statements.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/statement-keywords" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/literal-keywords.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/null" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/lock-statement.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/lock" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/long.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/modifiers.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/nameof.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/nameof" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/namespace-keywords.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/namespace" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/new-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/new-operator" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/object.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/operator-keywords.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/index" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/operator-overloading" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/out-parameter-modifier.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/method-parameters#out-parameter-modifier" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/params.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/method-parameters#params-modifier" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/partial-method.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/partial-member", - "redirect_document_id": true - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/reference-tables-for-types.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/return.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/sbyte.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/selection-statements.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/selection-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/short.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/sizeof.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/sizeof" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/stackalloc.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/stackalloc" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/string.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/struct.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/struct" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/switch.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/selection-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/throw.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/true-false-operators.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/true-false-operators" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/true-literal.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/true-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/true-false-operators" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/true.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/try-catch.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/try-catch-finally.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/try-finally.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/typeof.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/type-testing-and-cast#the-typeof-operator" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/types.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/uint.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/ulong.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/unchecked.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/checked-and-unchecked" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/ushort.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/using-statement.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/using" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/using-static.md", - "redirect_url": "/dotnet/csharp/language-reference/keywords/using-directive" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/value-types-table.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/value-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/value-types.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/value-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/var.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/declarations#implicitly-typed-local-variables" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/void.md", - "redirect_url": "/dotnet/csharp/language-reference/builtin-types/void" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/while.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/keywords/yield.md", - "redirect_url": "/dotnet/csharp/language-reference/statements/yield" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/language-specification/index.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/introduction" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/addition-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/and-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/and-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-and-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/bitwise-complement-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#bitwise-complement-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/conditional-and-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-and-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/conditional-or-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-or-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/decrement-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#decrement-operator---" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/dereference-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/pointer-related-operators#pointer-member-access-operator--" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/division-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/division-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#division-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/equality-comparison-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/equality-operators#equality-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/greater-than-equal-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#greater-than-or-equal-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/greater-than-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#greater-than-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/increment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#increment-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/index-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#indexer-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/invocation-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#invocation-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/left-shift-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/left-shift-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#left-shift-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/less-than-equal-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#less-than-or-equal-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/less-than-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#less-than-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/logical-negation-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-negation-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/member-access-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#member-access-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/modulus-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/modulus-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#remainder-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/multiplication-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/multiplication-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#multiplication-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/namespace-alias-qualifer.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/namespace-alias-qualifier" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/not-equal-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/equality-operators#inequality-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/null-conditional-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/null-coalescing-operator" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/null-conditional-operators.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/or-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/or-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-or-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/remainder-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/remainder-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#remainder-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/right-shift-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/right-shift-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#right-shift-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/null-parameter-check.md", - "redirect_url": "/dotnet/csharp/language-reference/operators" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/subtraction-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/type-testing-and-conversion-operators.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/type-testing-and-cast" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/xor-assignment-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/operators/xor-operator.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-exclusive-or-operator-" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/index.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives", - "redirect_document_id": true - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-define.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-elif.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-else.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-endif.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-endregion.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-error.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-if.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-line.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-nullable.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-pragma-checksum.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-pragma-warning.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-pragma.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-region.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-undef.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-warning.md", - "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-10.0/lambda-attributes.md", - "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-10.0/lambda-improvements" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.0/index.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/readme" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.1/index.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/readme" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.2/index.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#928-input-parameters" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.3/index.md", - "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-7.3/ref-local-reassignment" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-reference-types-specification.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-constructor-analysis.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-parameter-default-value-analysis.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/index.md", - "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-9.0/records" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-10.0/index.md", - "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-10.0/record-structs" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-11.0/index.md", - "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/static-abstracts-in-interfaces" - }, - { - "source_path_from_root": "/docs/csharp/language-reference/specifications.md", - "redirect_url": "/dotnet/csharp/specifications" - }, - { - "source_path_from_root": "/docs/csharp/linq/create-a-nested-group.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/grouping-data" - }, - { - "source_path_from_root": "/docs/csharp/linq/group-query-results.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/grouping-data" - }, - { - "source_path_from_root": "/docs/csharp/linq/join-by-using-composite-keys.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" - }, - { - "source_path_from_root": "/docs/csharp/linq/perform-a-subquery-on-a-grouping-operation.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/grouping-data" - }, - { - "source_path_from_root": "/docs/csharp/linq/linq-to-objects.md", - "redirect_url": "/dotnet/csharp/linq/introduction-to-linq-queries" - }, - { - "source_path_from_root": "/docs/csharp/linq/perform-grouped-joins.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" - }, - { - "source_path_from_root": "/docs/csharp/linq/perform-inner-joins.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" - }, - { - "source_path_from_root": "/docs/csharp/linq/perform-left-outer-joins.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" - }, - { - "source_path_from_root": "/docs/csharp/linq/order-the-results-of-a-join-clause.md", - "redirect_url": "/dotnet/csharp/linq/standard-query-operators/" - }, - { - "source_path_from_root": "/docs/csharp/linq/perform-custom-join-operations.md", - "redirect_url": "/dotnet/csharp/linq/" - }, - { - "source_path_from_root": "/docs/csharp/linq/query-expression-basics.md", - "redirect_url": "/dotnet/csharp/linq/get-started/query-expression-basics" - }, - { - "source_path_from_root": "/docs/csharp/linq/query-a-collection-of-objects.md", - "redirect_url": "/dotnet/csharp/linq/get-started/introduction-to-linq-queries" - }, - { - "source_path_from_root": "/docs/csharp/linq/return-a-query-from-a-method.md", - "redirect_url": "/dotnet/csharp/linq/get-started/features-that-support-linq#expressions-as-data" - }, - { - "source_path_from_root": "/docs/csharp/linq/dynamically-specify-predicate-filters-at-runtime.md", - "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" - }, - { - "source_path_from_root": "/docs/csharp/linq/handle-null-values-in-query-expressions.md", - "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" - }, - { - "source_path_from_root": "/docs/csharp/linq/handle-exceptions-in-query-expressions.md", - "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" - }, - { - "source_path_from_root": "/docs/csharp/linq/store-the-results-of-a-query-in-memory.md", - "redirect_url": "/dotnet/csharp/linq/get-started/introduction-to-linq-queries" - }, - { - "source_path_from_root": "/docs/csharp/linq/write-linq-queries.md", - "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" - }, - { - "source_path_from_root": "/docs/csharp/linq/linq-in-csharp.md", - "redirect_url": "/dotnet/csharp/linq/" - }, - { - "source_path_from_root": "/docs/csharp/local-functions-vs-lambdas.md", - "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/local-functions" - }, - { - "source_path_from_root": "/docs/csharp/methods-lambda-expressions.md", - "redirect_url": "/dotnet/csharp/language-reference/operators/lambda-expressions" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0012.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0022.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0035.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0056.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0057.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0105.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0111.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0121.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0138.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0171.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0182.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0185.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lock-semantics" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0192.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0193.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0196.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0199.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0200.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0206.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0208.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0209.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0210.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0211.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0212.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0213.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0214.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0215.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0216.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0227.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0242.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0243.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0244.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0245.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0254.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0459.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0821.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0217.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0218.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0225.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0231.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0248.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0251.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0261.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0262.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0263.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0264.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0265.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0267.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0282.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0400.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0404.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0415.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0416.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0447.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0431.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0430.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0432.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0439.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0440.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0448.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0457.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0425.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0428.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" - }, - { - "source_path_from_root": "/docs/csharp/misc/cs0460.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/return.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/jump-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0466.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + "source_path_from_root": "/docs/csharp/language-reference/keywords/sbyte.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0470.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/selection-statements.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/selection-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0473.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/short.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0531.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/sizeof.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/sizeof" }, { - "source_path_from_root": "/docs/csharp/misc/cs0535.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/stackalloc.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/stackalloc" }, { - "source_path_from_root": "/docs/csharp/misc/cs0501.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/keywords/string.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/reference-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0514.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#static-constructors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/struct.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/struct" }, { - "source_path_from_root": "/docs/csharp/misc/cs0515.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#static-constructors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/switch.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/selection-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0132.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#static-constructors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/throw.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0516.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + "source_path_from_root": "/docs/csharp/language-reference/keywords/true-false-operators.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/true-false-operators" }, { - "source_path_from_root": "/docs/csharp/misc/cs0517.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + "source_path_from_root": "/docs/csharp/language-reference/keywords/true-literal.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" }, { - "source_path_from_root": "/docs/csharp/misc/cs0522.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + "source_path_from_root": "/docs/csharp/language-reference/keywords/true-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/true-false-operators" }, { - "source_path_from_root": "/docs/csharp/misc/cs0526.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations" + "source_path_from_root": "/docs/csharp/language-reference/keywords/true.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/bool" }, { - "source_path_from_root": "/docs/csharp/misc/cs0538.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/try-catch.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0539.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/try-catch-finally.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0540.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/try-finally.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/exception-handling-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0541.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/typeof.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/type-testing-and-cast#the-typeof-operator" }, { - "source_path_from_root": "/docs/csharp/misc/cs0550.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/types.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords" }, { - "source_path_from_root": "/docs/csharp/misc/cs0551.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/uint.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0553.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/ulong.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0554.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/unchecked.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/checked-and-unchecked" }, { - "source_path_from_root": "/docs/csharp/misc/cs0555.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/ushort.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/integral-numeric-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0556.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/using-statement.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/using" }, { - "source_path_from_root": "/docs/csharp/misc/cs0557.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/using-static.md", + "redirect_url": "/dotnet/csharp/language-reference/keywords/using-directive" }, { - "source_path_from_root": "/docs/csharp/misc/cs0558.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/value-types-table.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/value-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0559.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/value-types.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/value-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0562.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/var.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/declarations#implicitly-typed-local-variables" }, { - "source_path_from_root": "/docs/csharp/misc/cs0564.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/void.md", + "redirect_url": "/dotnet/csharp/language-reference/builtin-types/void" }, { - "source_path_from_root": "/docs/csharp/misc/cs0567.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/while.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/iteration-statements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0590.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/keywords/yield.md", + "redirect_url": "/dotnet/csharp/language-reference/statements/yield" }, { - "source_path_from_root": "/docs/csharp/misc/cs0660.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/language-specification/index.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/introduction" }, { - "source_path_from_root": "/docs/csharp/misc/cs0661.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/addition-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0715.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/and-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0728.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" + "source_path_from_root": "/docs/csharp/language-reference/operators/and-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-and-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0735.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/bitwise-complement-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#bitwise-complement-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0739.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/conditional-and-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-and-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs1037.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/conditional-or-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-or-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs1553.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/decrement-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#decrement-operator---" }, { - "source_path_from_root": "/docs/csharp/misc/cs1554.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/dereference-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/pointer-related-operators#pointer-member-access-operator--" }, { - "source_path_from_root": "/docs/csharp/misc/cs0568.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructors-in-struct-types" + "source_path_from_root": "/docs/csharp/language-reference/operators/division-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0573.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructors-in-struct-types" + "source_path_from_root": "/docs/csharp/language-reference/operators/division-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#division-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0570.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#CS0570" + "source_path_from_root": "/docs/csharp/language-reference/operators/equality-comparison-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/equality-operators#equality-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0576.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/greater-than-equal-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#greater-than-or-equal-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0577.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/greater-than-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#greater-than-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0578.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/increment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#increment-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0582.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/index-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#indexer-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0609.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/invocation-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#invocation-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0629.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/left-shift-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0591.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/operators/left-shift-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#left-shift-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0599.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/operators/less-than-equal-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#less-than-or-equal-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0611.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/less-than-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/comparison-operators#less-than-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0617.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/operators/logical-negation-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-negation-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0623.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/member-access-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#member-access-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0625.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/modulus-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0631.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/modulus-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#remainder-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0633.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/operators/multiplication-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0636.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/multiplication-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#multiplication-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0637.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/namespace-alias-qualifer.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/namespace-alias-qualifier" }, { - "source_path_from_root": "/docs/csharp/misc/cs0641.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/not-equal-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/equality-operators#inequality-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0646.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/null-conditional-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/null-coalescing-operator" }, { - "source_path_from_root": "/docs/csharp/misc/cs0647.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/null-conditional-operators.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0643.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/operators/or-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0653.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/or-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-or-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0657.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/remainder-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0658.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/remainder-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#remainder-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0655.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/operators/right-shift-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0663.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + "source_path_from_root": "/docs/csharp/language-reference/operators/right-shift-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#right-shift-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0668.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/null-parameter-check.md", + "redirect_url": "/dotnet/csharp/language-reference/operators" }, { - "source_path_from_root": "/docs/csharp/misc/cs0674.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + "source_path_from_root": "/docs/csharp/language-reference/operators/subtraction-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0685.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/type-testing-and-conversion-operators.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/type-testing-and-cast" }, { - "source_path_from_root": "/docs/csharp/misc/cs0687.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + "source_path_from_root": "/docs/csharp/language-reference/operators/xor-assignment-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0710.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations" + "source_path_from_root": "/docs/csharp/language-reference/operators/xor-operator.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-exclusive-or-operator-" }, { - "source_path_from_root": "/docs/csharp/misc/cs0719.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/index.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives", + "redirect_document_id": true }, { - "source_path_from_root": "/docs/csharp/misc/cs0747.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-define.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0748.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#lambda-expression-parameters-and-returns" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-elif.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0750.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-else.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0751.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-endif.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0754.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-endregion.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0755.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-error.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0756.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-if.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0757.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-line.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0758.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-nullable.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0759.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-pragma-checksum.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0761.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-pragma-warning.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0762.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-pragma.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0763.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-region.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0764.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-undef.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0765.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/preprocessor-directives/preprocessor-warning.md", + "redirect_url": "/dotnet/csharp/language-reference/preprocessor-directives" }, { - "source_path_from_root": "/docs/csharp/misc/cs0815.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-10.0/lambda-attributes.md", + "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-10.0/lambda-improvements" }, { - "source_path_from_root": "/docs/csharp/misc/cs0820.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.0/index.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/readme" }, { - "source_path_from_root": "/docs/csharp/misc/cs0824.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.1/index.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/readme" }, { - "source_path_from_root": "/docs/csharp/misc/cs0828.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.2/index.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/variables#928-input-parameters" }, { - "source_path_from_root": "/docs/csharp/misc/cs0831.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.3/index.md", + "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-7.3/ref-local-reassignment" }, { - "source_path_from_root": "/docs/csharp/misc/cs0832.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-reference-types-specification.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0835.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-constructor-analysis.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0837.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/nullable-parameter-default-value-analysis.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/types#893-nullable-reference-types" }, { - "source_path_from_root": "/docs/csharp/misc/cs0838.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-9.0/index.md", + "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-9.0/records" }, { - "source_path_from_root": "/docs/csharp/misc/cs0839.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-10.0/index.md", + "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-10.0/record-structs" }, { - "source_path_from_root": "/docs/csharp/misc/cs1007.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-11.0/index.md", + "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/static-abstracts-in-interfaces" }, { - "source_path_from_root": "/docs/csharp/misc/cs1011.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + "source_path_from_root": "/docs/csharp/language-reference/specifications.md", + "redirect_url": "/dotnet/csharp/specifications" }, { - "source_path_from_root": "/docs/csharp/misc/cs1012.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + "source_path_from_root": "/docs/csharp/linq/create-a-nested-group.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/grouping-data" }, { - "source_path_from_root": "/docs/csharp/misc/cs1014.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + "source_path_from_root": "/docs/csharp/linq/group-query-results.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/grouping-data" }, { - "source_path_from_root": "/docs/csharp/misc/cs1016.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + "source_path_from_root": "/docs/csharp/linq/join-by-using-composite-keys.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1020.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + "source_path_from_root": "/docs/csharp/linq/perform-a-subquery-on-a-grouping-operation.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/grouping-data" }, { - "source_path_from_root": "/docs/csharp/misc/cs1024.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/linq-to-objects.md", + "redirect_url": "/dotnet/csharp/linq/introduction-to-linq-queries" }, { - "source_path_from_root": "/docs/csharp/misc/cs1025.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/perform-grouped-joins.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1027.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/perform-inner-joins.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1028.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/perform-left-outer-joins.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/join-operations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1030.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/order-the-results-of-a-join-clause.md", + "redirect_url": "/dotnet/csharp/linq/standard-query-operators/" }, { - "source_path_from_root": "/docs/csharp/misc/cs1032.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/perform-custom-join-operations.md", + "redirect_url": "/dotnet/csharp/linq/" }, { - "source_path_from_root": "/docs/csharp/misc/cs1038.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/query-expression-basics.md", + "redirect_url": "/dotnet/csharp/linq/get-started/query-expression-basics" }, { - "source_path_from_root": "/docs/csharp/misc/cs1039.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + "source_path_from_root": "/docs/csharp/linq/query-a-collection-of-objects.md", + "redirect_url": "/dotnet/csharp/linq/get-started/introduction-to-linq-queries" }, { - "source_path_from_root": "/docs/csharp/misc/cs1040.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/linq/return-a-query-from-a-method.md", + "redirect_url": "/dotnet/csharp/linq/get-started/features-that-support-linq#expressions-as-data" }, { - "source_path_from_root": "/docs/csharp/misc/cs1043.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + "source_path_from_root": "/docs/csharp/linq/dynamically-specify-predicate-filters-at-runtime.md", + "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" }, { - "source_path_from_root": "/docs/csharp/misc/cs1100.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/linq/handle-null-values-in-query-expressions.md", + "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" }, { - "source_path_from_root": "/docs/csharp/misc/cs1101.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/linq/handle-exceptions-in-query-expressions.md", + "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" }, { - "source_path_from_root": "/docs/csharp/misc/cs1102.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/linq/store-the-results-of-a-query-in-memory.md", + "redirect_url": "/dotnet/csharp/linq/get-started/introduction-to-linq-queries" }, { - "source_path_from_root": "/docs/csharp/misc/cs1103.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/linq/write-linq-queries.md", + "redirect_url": "/dotnet/csharp/linq/get-started/write-linq-queries" }, { - "source_path_from_root": "/docs/csharp/misc/cs1104.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + "source_path_from_root": "/docs/csharp/linq/linq-in-csharp.md", + "redirect_url": "/dotnet/csharp/linq/" }, { - "source_path_from_root": "/docs/csharp/misc/cs1105.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/local-functions-vs-lambdas.md", + "redirect_url": "/dotnet/csharp/programming-guide/classes-and-structs/local-functions" }, { - "source_path_from_root": "/docs/csharp/misc/cs1106.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/methods-lambda-expressions.md", + "redirect_url": "/dotnet/csharp/language-reference/operators/lambda-expressions" }, { - "source_path_from_root": "/docs/csharp/misc/cs1109.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/misc/cs0012.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" }, { - "source_path_from_root": "/docs/csharp/misc/cs1110.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/misc/cs0022.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1113.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + "source_path_from_root": "/docs/csharp/misc/cs0035.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1510.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/misc/cs0056.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1517.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0057.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1529.md", + "source_path_from_root": "/docs/csharp/misc/cs0105.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1534.md", + "source_path_from_root": "/docs/csharp/misc/cs0111.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" }, { - "source_path_from_root": "/docs/csharp/misc/cs1535.md", + "source_path_from_root": "/docs/csharp/misc/cs0121.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" }, { - "source_path_from_root": "/docs/csharp/misc/cs1537.md", + "source_path_from_root": "/docs/csharp/misc/cs0138.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1552.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/misc/cs0171.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1560.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0182.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" }, { - "source_path_from_root": "/docs/csharp/misc/cs1576.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0185.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lock-semantics" }, { - "source_path_from_root": "/docs/csharp/misc/cs1578.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0192.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1586.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + "source_path_from_root": "/docs/csharp/misc/cs0193.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1605.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/misc/cs0196.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1608.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/misc/cs0199.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1611.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + "source_path_from_root": "/docs/csharp/misc/cs0200.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1618.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/misc/cs0206.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1621.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + "source_path_from_root": "/docs/csharp/misc/cs0208.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1622.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0209.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1623.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/misc/cs0210.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1624.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0211.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1625.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0212.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1626.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0213.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1627.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0214.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1628.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + "source_path_from_root": "/docs/csharp/misc/cs0215.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1629.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0216.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1631.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0227.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1632.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + "source_path_from_root": "/docs/csharp/misc/cs0242.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1633.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0243.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1634.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0244.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1635.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0245.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" }, { - "source_path_from_root": "/docs/csharp/misc/cs1637.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + "source_path_from_root": "/docs/csharp/misc/cs0254.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1641.md", + "source_path_from_root": "/docs/csharp/misc/cs0459.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1642.md", + "source_path_from_root": "/docs/csharp/misc/cs0821.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1643.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/misc/cs0217.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1649.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/misc/cs0218.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1651.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/misc/cs0225.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" }, { - "source_path_from_root": "/docs/csharp/misc/cs1655.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/misc/cs0231.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" }, { - "source_path_from_root": "/docs/csharp/misc/cs1663.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/misc/cs0248.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1665.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/misc/cs0251.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/feature-version-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1666.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + "source_path_from_root": "/docs/csharp/misc/cs0261.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1667.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/misc/cs0262.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1657.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + "source_path_from_root": "/docs/csharp/misc/cs0263.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1660.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/misc/cs0264.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1661.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/misc/cs0265.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1662.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/misc/cs0267.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1670.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + "source_path_from_root": "/docs/csharp/misc/cs0282.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" }, { - "source_path_from_root": "/docs/csharp/misc/cs1671.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + "source_path_from_root": "/docs/csharp/misc/cs0400.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" }, { - "source_path_from_root": "/docs/csharp/misc/cs1673.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + "source_path_from_root": "/docs/csharp/misc/cs0404.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1676.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/misc/cs0415.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1677.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/misc/cs0416.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1678.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + "source_path_from_root": "/docs/csharp/misc/cs0447.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1679.md", + "source_path_from_root": "/docs/csharp/misc/cs0431.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1680.md", + "source_path_from_root": "/docs/csharp/misc/cs0430.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1681.md", + "source_path_from_root": "/docs/csharp/misc/cs0432.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1674.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" + "source_path_from_root": "/docs/csharp/misc/cs0439.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1686.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + "source_path_from_root": "/docs/csharp/misc/cs0440.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1688.md", + "source_path_from_root": "/docs/csharp/misc/cs0448.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0457.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0425.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0428.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs0460.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0466.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0470.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0473.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0531.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0535.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0501.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0514.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#static-constructors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0515.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#static-constructors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0132.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#static-constructors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0516.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0517.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0522.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-calls-with-base-and-this" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0526.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0538.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0539.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0540.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0541.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0550.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0551.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0553.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0554.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0555.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0556.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0557.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0558.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0559.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0562.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0564.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0567.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0590.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0660.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0661.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0715.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0728.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#using-variable-scope-and-control-flow" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0735.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0739.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1037.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1553.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1554.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0568.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructors-in-struct-types" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0573.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructors-in-struct-types" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0570.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#CS0570" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0576.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0577.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0578.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0582.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0609.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0629.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0591.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0599.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0611.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0617.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0623.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0625.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0631.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0633.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0636.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0637.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0641.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0646.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0647.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0643.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0653.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0657.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0658.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0655.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0663.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0668.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0674.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0685.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0687.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0710.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0719.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0747.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0748.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#lambda-expression-parameters-and-returns" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0750.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0751.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0754.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0755.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0756.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0757.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0758.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0759.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0761.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0762.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0763.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0764.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0765.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, { - "source_path_from_root": "/docs/csharp/misc/cs1689.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + "source_path_from_root": "/docs/csharp/misc/cs0815.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs0820.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0824.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations" + }, { - "source_path_from_root": "/docs/csharp/misc/cs1692.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0828.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs0831.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0832.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0835.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, { - "source_path_from_root": "/docs/csharp/misc/cs1694.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs0837.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs0838.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/expression-tree-restrictions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs0839.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1007.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1011.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1012.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1014.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1016.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/parameter-argument-mismatch" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1020.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1024.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1025.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1027.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1028.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1030.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1032.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1038.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1039.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/string-literal" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1040.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1043.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/property-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1100.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1101.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1102.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1103.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1104.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1105.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1106.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1109.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1110.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1113.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/extension-declarations" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1510.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1517.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1529.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1534.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1535.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1537.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1552.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1560.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1576.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1578.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1586.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1605.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1608.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1611.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1618.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1621.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1622.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1623.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1624.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1625.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1626.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1627.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1628.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1629.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1631.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1632.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1633.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1634.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1635.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1637.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/iterator-yield" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1641.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1642.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + }, { - "source_path_from_root": "/docs/csharp/misc/cs1695.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs1643.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs1649.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1651.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1655.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1663.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1665.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1666.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/unsafe-code-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1667.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1657.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors" + }, { - "source_path_from_root": "/docs/csharp/misc/cs1696.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs1660.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1706.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + "source_path_from_root": "/docs/csharp/misc/cs1661.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1709.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + "source_path_from_root": "/docs/csharp/misc/cs1662.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs1670.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1671.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1673.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + }, { - "source_path_from_root": "/docs/csharp/misc/cs1714.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + "source_path_from_root": "/docs/csharp/misc/cs1676.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, { - "source_path_from_root": "/docs/csharp/misc/cs1730.md", - "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + "source_path_from_root": "/docs/csharp/misc/cs1677.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1678.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1679.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1680.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1681.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, + { + "source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs1674.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-statement-declaration-errors#implementing-idisposable-and-iasyncdisposable" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1686.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1688.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" }, + { + "source_path_from_root": "/docs/csharp/misc/cs1689.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/attribute-usage-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1692.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1694.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1695.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1696.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1706.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors#syntax-limitations-in-lambda-expressions" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1709.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/preprocessor-errors" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1714.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/assembly-references" + }, + { + "source_path_from_root": "/docs/csharp/misc/cs1730.md", + "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/using-directive-errors" + }, { "source_path_from_root": "/docs/csharp/misc/cs1731.md", "redirect_url": "/dotnet/csharp/language-reference/compiler-messages/lambda-expression-errors" @@ -2951,7 +2955,7 @@ }, { "source_path_from_root": "/docs/csharp/namespaces-and-assemblies.md", - "redirect_url": "/dotnet/csharp/fundamentals/types/namespaces" + "redirect_url": "/dotnet/csharp/fundamentals/program-structure/namespaces" }, { "source_path_from_root": "/docs/csharp/nullable-attributes.md", @@ -4631,15 +4635,15 @@ }, { "source_path_from_root": "/docs/csharp/programming-guide/namespaces/how-to-use-the-my-namespace.md", - "redirect_url": "/dotnet/csharp/fundamentals/types/namespaces" + "redirect_url": "/dotnet/csharp/fundamentals/program-structure/namespaces" }, { "source_path_from_root": "/docs/csharp/programming-guide/namespaces/index.md", - "redirect_url": "/dotnet/csharp/fundamentals/types/namespaces" + "redirect_url": "/dotnet/csharp/fundamentals/program-structure/namespaces" }, { "source_path_from_root": "/docs/csharp/programming-guide/namespaces/using-namespaces.md", - "redirect_url": "/dotnet/csharp/fundamentals/types/namespaces" + "redirect_url": "/dotnet/csharp/fundamentals/program-structure/namespaces" }, { "source_path_from_root": "/docs/csharp/programming-guide/nullable-types/boxing-nullable-types.md", diff --git a/docs/csharp/fundamentals/program-structure/organizing-programs.md b/docs/csharp/fundamentals/program-structure/organizing-programs.md new file mode 100644 index 0000000000000..39e687c8aa067 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/organizing-programs.md @@ -0,0 +1,90 @@ +--- +title: "Organizing programs" +description: Learn how to organize C# programs using solutions, projects, assemblies, namespaces, and types to build maintainable, well-structured applications. +ms.date: 03/04/2026 +ai-usage: ai-assisted +helpviewer_keywords: + - "C# language, program organization" + - "assemblies [C#]" + - "namespaces [C#], organizing" + - "solutions [C#]" +--- +# Organizing programs + +As a C# application grows, you need a clear strategy for organizing code. .NET provides a hierarchy of organizational tools—solutions, projects, assemblies, namespaces, and types—that work together to keep large codebases manageable. + +## The organizational hierarchy + +A typical .NET application is organized in layers, from broadest to most specific: + +| Level | What it is | Example | +|---|---|---| +| **Solution** | A container that groups related projects | `MyApp.sln` | +| **Project** | A build unit that produces one assembly | `MyApp.Web.csproj` | +| **Assembly** | A compiled `.dll` or `.exe` file | `MyApp.Web.dll` | +| **Namespace** | A logical grouping of types within an assembly | `MyApp.Web.Controllers` | +| **Type** | A class, struct, interface, enum, or delegate | `OrderController` | + +Each level serves a different purpose. Solutions organize your development workflow. Projects define what gets compiled together. Assemblies are the unit of deployment and versioning. Namespaces prevent naming collisions and make types discoverable. Types define the actual behavior and data. + +## Projects and assemblies + +Each project compiles into a single assembly—a `.dll` (class library) or `.exe` (executable). Split your code into multiple projects when you want to: + +- **Separate concerns** — keep your data access, business logic, and presentation layers independent. +- **Share code** — create a class library that multiple applications reference. +- **Control dependencies** — a project can only use types from projects it explicitly references. + +The following project structure demonstrates a common pattern: + +:::code language="csharp" source="snippets/organizing-programs/AppDemo.cs" id="ProjectStructure"::: + +Create and reference projects with the `dotnet` CLI: + +```bash +dotnet new classlib -n MyApp.Core +dotnet new console -n MyApp.Console +dotnet add MyApp.Console reference MyApp.Core +``` + +## Namespaces mirror folder structure + +By convention, namespace names follow the folder structure of your project. This convention makes types easy to find—when you see `MyApp.Services.Payments`, you know to look in the `Services/Payments` folder: + +:::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: + +The .NET SDK supports this convention automatically. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file—but following the convention keeps your codebase predictable. + +## Choosing how to split namespaces + +Group related types into namespaces by feature or responsibility, not by type kind. For example, prefer this organization: + +:::code language="csharp" source="snippets/organizing-programs/Payments.cs" id="FeatureOrganization"::: + +Over grouping by type kind (like putting all interfaces in a `MyApp.Interfaces` namespace or all models in `MyApp.Models`). Feature-based organization keeps related types together, making the code easier to navigate and understand. + +## Access modifiers and assemblies + +Access modifiers interact with the project/assembly structure to control visibility: + +- `public` — accessible from any assembly that references this one. +- `internal` — accessible only within the same assembly (the default for top-level types). +- `private`, `protected`, `private protected`, `protected internal` — control visibility at the type member level. + +Use `internal` to hide implementation details that other projects shouldn't depend on. This is especially useful for shared libraries: + +:::code language="csharp" source="snippets/organizing-programs/Inventory.cs" id="AccessModifiers"::: + +## Practical tips + +- **Start simple.** A single project works well for small applications. Split into multiple projects only when you have a clear reason. +- **Name namespaces consistently.** Use `CompanyName.ProductName.Feature` as your naming pattern—for example, `Contoso.Inventory.Shipping`. +- **Keep projects focused.** Each project should have a single responsibility. If a project does too many unrelated things, consider splitting it. +- **Use file-scoped namespaces.** The `namespace MyApp.Services;` syntax (C# 10) reduces nesting and is the recommended style for new code. +- **Leverage `global using` directives.** Place common imports in a `GlobalUsings.cs` file to reduce repetition across files. For more information, see [Namespaces and using directives](namespaces.md). + +## See also + +- [Namespaces and using directives](namespaces.md) — declare namespaces, import types with `using`, and configure global usings. +- [Assemblies in .NET](../../../standard/assembly/index.md) — learn about assemblies, versioning, and deployment. +- [.NET project SDKs](../../../core/project-sdk/overview.md) — project file settings including `RootNamespace` and `ImplicitUsings`. diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs new file mode 100644 index 0000000000000..ef42ada3b3d23 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs @@ -0,0 +1,12 @@ +// +// MyApp.Core (class library) — shared business logic +namespace MyApp.Core; + +public class Order +{ + public required string ProductName { get; init; } + public int Quantity { get; init; } + public decimal UnitPrice { get; init; } + public decimal Total => Quantity * UnitPrice; +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Inventory.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Inventory.cs new file mode 100644 index 0000000000000..8079d614e2a4a --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Inventory.cs @@ -0,0 +1,23 @@ +// +namespace MyApp.Inventory; + +// Public — other projects can use this type +public class InventoryService +{ + public int GetStockLevel(string productName) => + StockDatabase.Lookup(productName); +} + +// Internal — only visible within this assembly +internal static class StockDatabase +{ + private static readonly Dictionary _stock = new() + { + ["Widget"] = 42, + ["Gadget"] = 17 + }; + + internal static int Lookup(string productName) => + _stock.GetValueOrDefault(productName); +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/OrderService.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/OrderService.cs new file mode 100644 index 0000000000000..2b6e5e466c095 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/OrderService.cs @@ -0,0 +1,16 @@ +// +// File: Services/OrderService.cs +// Namespace mirrors the folder path +using MyApp.Core; + +namespace MyApp.Services; + +public class OrderService +{ + public Order CreateOrder(string product, int quantity, decimal price) => + new() { ProductName = product, Quantity = quantity, UnitPrice = price }; + + public string FormatSummary(Order order) => + $"{order.Quantity}x {order.ProductName} = {order.Total:C}"; +} +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Payments.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Payments.cs new file mode 100644 index 0000000000000..a301bb81b9c54 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Payments.cs @@ -0,0 +1,20 @@ +// +// Good: group by feature +namespace MyApp.Payments; + +public interface IPaymentProcessor +{ + bool ProcessPayment(decimal amount); +} + +public class CreditCardProcessor : IPaymentProcessor +{ + public bool ProcessPayment(decimal amount) + { + Console.WriteLine($"Processing credit card payment of {amount:C}"); + return true; + } +} + +public record PaymentResult(bool Success, string? TransactionId); +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs new file mode 100644 index 0000000000000..5414f2195ff12 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs @@ -0,0 +1,13 @@ +using MyApp.Services; +using MyApp.Payments; +using MyApp.Inventory; + +var service = new OrderService(); +var order = service.CreateOrder("Widget", 3, 9.99m); +Console.WriteLine(service.FormatSummary(order)); + +var processor = new CreditCardProcessor(); +processor.ProcessPayment(order.Total); + +var inventory = new InventoryService(); +Console.WriteLine($"Stock level for Widget: {inventory.GetStockLevel("Widget")}"); diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/organizing-programs.csproj b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/organizing-programs.csproj new file mode 100644 index 0000000000000..f2e4508cfb6e2 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/organizing-programs.csproj @@ -0,0 +1,11 @@ + + + + Exe + net10.0 + enable + enable + MyApp + + + diff --git a/docs/csharp/language-reference/keywords/namespace.md b/docs/csharp/language-reference/keywords/namespace.md index 6a67cef3da439..dd68dac1fe067 100644 --- a/docs/csharp/language-reference/keywords/namespace.md +++ b/docs/csharp/language-reference/keywords/namespace.md @@ -102,4 +102,4 @@ For more information on file scoped namespace declarations, see the [feature spe - [using](using-directive.md) - [using static](using-directive.md) - [Namespace alias qualifier `::`](../operators/namespace-alias-qualifier.md) -- [Namespaces](../../fundamentals/types/namespaces.md) +- [Namespaces](../../fundamentals/program-structure/namespaces.md) diff --git a/docs/csharp/language-reference/keywords/using-directive.md b/docs/csharp/language-reference/keywords/using-directive.md index 82530486f736f..6ebbd9282ed64 100644 --- a/docs/csharp/language-reference/keywords/using-directive.md +++ b/docs/csharp/language-reference/keywords/using-directive.md @@ -187,7 +187,7 @@ For more information on the *global using* modifier, see the [global usings feat ## See also - [C# keywords](index.md) -- [Namespaces](../../fundamentals/types/namespaces.md) +- [Namespaces](../../fundamentals/program-structure/namespaces.md) - [Style rule IDE0005 - Remove unnecessary 'using' directives](../../../fundamentals/code-analysis/style-rules/ide0005.md) - [Style rule IDE0065 - 'using' directive placement](../../../fundamentals/code-analysis/style-rules/ide0065.md) - [`using` statement](../statements/using.md) diff --git a/docs/csharp/misc/cs0101.md b/docs/csharp/misc/cs0101.md index a6785cc54e80c..fec76070e3a32 100644 --- a/docs/csharp/misc/cs0101.md +++ b/docs/csharp/misc/cs0101.md @@ -12,7 +12,7 @@ ms.assetid: edb5246b-c16b-4845-bb2d-0ef769d014c7 The namespace 'namespace' already contains a definition for 'type' - A [namespace](../language-reference/keywords/namespace.md) has duplicate identifiers. Rename or delete one of the duplicate identifiers. For more information, see [Namespaces](../fundamentals/types/namespaces.md) + A [namespace](../language-reference/keywords/namespace.md) has duplicate identifiers. Rename or delete one of the duplicate identifiers. For more information, see [Namespaces](../fundamentals/program-structure/namespaces.md) The following sample generates CS0101: diff --git a/docs/csharp/misc/cs1527.md b/docs/csharp/misc/cs1527.md index 0c4194ed0e4ab..02419788e4df8 100644 --- a/docs/csharp/misc/cs1527.md +++ b/docs/csharp/misc/cs1527.md @@ -39,7 +39,7 @@ private struct S1 {} ## See also -- [Namespaces](../fundamentals/types/namespaces.md) +- [Namespaces](../fundamentals/program-structure/namespaces.md) - [:: Operator](../language-reference/operators/namespace-alias-qualifier.md) - [Accessibility Domain](../language-reference/keywords/accessibility-domain.md) - [Access Modifiers](../programming-guide/classes-and-structs/access-modifiers.md) diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index 69bc030441643..f292630c2bc03 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -37,6 +37,12 @@ items: items: - name: Overview href: fundamentals/program-structure/index.md + - name: Namespaces + href: fundamentals/program-structure/namespaces.md + - name: Preprocessor directives + href: fundamentals/program-structure/preprocessor-directives.md + - name: Organizing programs + href: fundamentals/program-structure/organizing-programs.md - name: Main method href: fundamentals/program-structure/main-command-line.md - name: Top-level statements @@ -45,8 +51,6 @@ items: items: - name: Overview href: fundamentals/types/index.md - - name: Namespaces - href: fundamentals/types/namespaces.md # TODO: tuples - name: Classes href: fundamentals/types/classes.md From 23fed87db49fbadb360cd58e5c2a4f2d291453c2 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 5 Mar 2026 14:17:19 -0500 Subject: [PATCH 06/34] Content edit. --- .../fundamentals/program-structure/index.md | 23 +++++++++------ .../program-structure/namespaces.md | 12 ++++---- .../program-structure/organizing-programs.md | 28 +++++++++---------- .../preprocessor-directives.md | 2 +- 4 files changed, 36 insertions(+), 29 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 87cb6b5231260..497367d4888b7 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -1,6 +1,6 @@ --- title: "General structure of a C# program" -description: Learn how C# programs are structured, including the three application styles—file-based apps, top-level statements, and Main method programs—and the building blocks that make up every program. +description: Learn how C# programs are structured, including the choice between file-based and project-based apps, top-level statements and Main method entry points, and the building blocks that make up every program. ms.date: 03/04/2026 ai-usage: ai-assisted helpviewer_keywords: @@ -16,11 +16,16 @@ The following example shows a modern C# program that uses [file-scoped namespace This example uses *top-level statements* for the program's entry point. Only one file in a project can have top-level statements, and the entry point is the first line of program text in that file. File-scoped namespaces (the `namespace YourNamespace;` syntax) reduce nesting by applying the namespace to the entire file. -## Three application styles +## Choosing your application style -C# supports three styles for structuring an application's entry point. Choose the one that fits your scenario: +When you create a C# program, you make two independent choices about how to structure it: -### File-based apps +1. **File-based or project-based?** A file-based app runs from a single `.cs` file with no project file. A project-based app uses a `.csproj` file and can span multiple source files. +1. **Top-level statements or `Main` method?** Top-level statements let you write executable code directly at the top of a file. A `Main` method wraps the entry point in an explicit static method. + +Both project-based apps and file-based apps support either entry-point style. + +### File-based apps vs. project-based apps Beginning with C# 14 and .NET 10, *file-based apps* let you run a program contained in a single `*.cs` file without a project file. Store the following code in a file named `hello-world.cs` and run it with `dotnet run hello-world.cs`: @@ -34,16 +39,18 @@ The `#!` line enables Unix shells to run the file directly. On any Unix system, File-based apps support all C# syntax and can use [preprocessor directives](../../language-reference/preprocessor-directives.md#file-based-apps) to configure the build system. Use file-based apps for small command-line utilities, prototypes, and experiments. -### Top-level statements (project-based) +*Project-based apps* use a `.csproj` file and the [.NET CLI commands](../../../core/tools/index.md) `dotnet new`, `dotnet build`, and `dotnet run` workflow. Choose project-based apps when your program spans multiple files, or needs fine-grained build configuration. -For project-based apps, [top-level statements](top-level-statements.md) let you write executable code directly in one file, without wrapping it in a class and `Main` method. This is the default style when you create a new console app with `dotnet new console`. The first code example on this page uses this style. +### Top-level statements vs. `Main` method -### Main method (project-based) +[Top-level statements](top-level-statements.md) let you write executable code directly in one file, without wrapping it in a class and `Main` method. This is the default style when you create a new console app with `dotnet new console`. The first code example on this page uses this style. -You can also define an explicit static [`Main`](main-command-line.md) method as the program's entry point. This style is common in larger applications and when you need to control the method signature—for example, to return an exit code or accept `string[] args`: +You can also define an explicit static [`Main`](main-command-line.md) method as the program's entry point: :::code language="csharp" source="snippets/structure/Program.cs"::: +Either entry-point style works with both file-based and project-based apps. Both styles support the same features. + ## Building and running C# programs C# is a *compiled* language. For project-based apps, use the [`dotnet build`](../../../core/tools/dotnet-build.md) command to compile source files into a binary package and [`dotnet run`](../../../core/tools/dotnet-run.md) to build and run in one step. The `dotnet` CLI, included in the .NET SDK, provides many [tools](../../../core/tools/index.md) to create, build, and manage C# projects. diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index 3046a7a3461b5..e77ec8cf2713f 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -12,7 +12,7 @@ helpviewer_keywords: --- # Namespaces and using directives -Namespaces organize C# types into logical groups and prevent naming collisions between types that share the same name. Every .NET type belongs to a namespace—`System.Console`, `System.Collections.Generic.List`, and `System.Threading.Tasks.Task` are all examples. You encounter namespaces constantly, whether you're consuming .NET libraries or organizing your own code. +Namespaces organize C# types into logical groups and prevent naming collisions between types that share the same simple name. Every .NET type belongs to a namespace—`System.Console`, `System.Collections.Generic.List`, and `System.Threading.Tasks.Task` are all examples. You encounter namespaces constantly, whether you're consuming .NET libraries or organizing your own code. The following example shows how namespaces work together with `using` directives in a modern C# file: @@ -20,11 +20,11 @@ The following example shows how namespaces work together with `using` directives ## Using directives -Without a `using` directive, you must refer to every type by its *fully qualified name*—the complete namespace path plus the type name: +Without a `using` directive, you must refer to every type by its *fully qualified name*: the complete namespace path plus the type name: :::code language="csharp" source="snippets/namespaces/Basics.cs" id="FullyQualifiedName"::: -A `using` directive at the top of a file imports a namespace so you can use its types by their short names: +A `using` directive at the top of a file imports a namespace so you can use its types by their simple names: :::code language="csharp" source="snippets/namespaces/Basics.cs" id="UsingDirective"::: @@ -36,7 +36,7 @@ When you declare your own namespace, use the *file-scoped* syntax (introduced in :::code language="csharp" source="snippets/namespaces/FileScopedExample.cs" id="FileScopedNamespace"::: -File-scoped namespaces are the recommended style for new code. They reduce nesting and make files easier to read. You can only have one file-scoped namespace declaration per file. +File-scoped namespaces reduce nesting and make files easier to read. You can only have one file-scoped namespace declaration per file. The older block-scoped syntax wraps all types in braces. This style is still valid but adds an extra level of indentation: @@ -55,13 +55,13 @@ After declaring a global using, every file in the project can use types from tha ### Implicit usings -The .NET SDK automatically generates global using directives for the most common namespaces based on your project type. Implicit usings are enabled by default when `enable` is set in your project file. For example, a console app project automatically imports `System`, `System.Collections.Generic`, `System.IO`, `System.Linq`, `System.Threading`, and `System.Threading.Tasks`. +The .NET SDK automatically generates global using directives for the most common namespaces based on your project type. Implicit usings are enabled when `enable` is set in your project file. For example, a console app project automatically imports `System`, `System.Collections.Generic`, `System.IO`, `System.Linq`, `System.Threading`, and `System.Threading.Tasks`. The current SDK enables `ImplicitUsings` when you create a new project using `dotnet new`. For more information, see [Implicit using directives](../../../core/project-sdk/overview.md#implicit-using-directives). ## Static using directives -A `static using` directive (C# 6) imports the static members of a type so you can call them without the type name prefix: +A `static using` directive imports the static members of a type so you can call them without the type name prefix: :::code language="csharp" source="snippets/namespaces/StaticUsing.cs" id="StaticUsing"::: diff --git a/docs/csharp/fundamentals/program-structure/organizing-programs.md b/docs/csharp/fundamentals/program-structure/organizing-programs.md index 39e687c8aa067..25bc5ead513e3 100644 --- a/docs/csharp/fundamentals/program-structure/organizing-programs.md +++ b/docs/csharp/fundamentals/program-structure/organizing-programs.md @@ -19,17 +19,17 @@ A typical .NET application is organized in layers, from broadest to most specifi | Level | What it is | Example | |---|---|---| -| **Solution** | A container that groups related projects | `MyApp.sln` | +| **Solution** | A container that groups related projects | `MyApp.slnx` | | **Project** | A build unit that produces one assembly | `MyApp.Web.csproj` | -| **Assembly** | A compiled `.dll` or `.exe` file | `MyApp.Web.dll` | -| **Namespace** | A logical grouping of types within an assembly | `MyApp.Web.Controllers` | +| **Assembly** | The compiled `.dll` or `.exe` produced by a project | `MyApp.Web.dll` | +| **Namespace** | A logical grouping of types | `MyApp.Web.Controllers` | | **Type** | A class, struct, interface, enum, or delegate | `OrderController` | -Each level serves a different purpose. Solutions organize your development workflow. Projects define what gets compiled together. Assemblies are the unit of deployment and versioning. Namespaces prevent naming collisions and make types discoverable. Types define the actual behavior and data. +Each level serves a different purpose. Solutions organize your development workflow. Projects define what gets compiled together, and each project produces one assembly. Assemblies are the unit of deployment and versioning. Namespaces prevent naming collisions and make types discoverable—a single assembly can contain multiple namespaces, and a single namespace can span multiple assemblies. Types define the actual behavior and data. ## Projects and assemblies -Each project compiles into a single assembly—a `.dll` (class library) or `.exe` (executable). Split your code into multiple projects when you want to: +Each project compiles into a single assembly: a `.dll` (class library) or `.exe` (executable). Split your code into multiple projects when you want to: - **Separate concerns** — keep your data access, business logic, and presentation layers independent. - **Share code** — create a class library that multiple applications reference. @@ -41,7 +41,7 @@ The following project structure demonstrates a common pattern: Create and reference projects with the `dotnet` CLI: -```bash +```dotnetcli dotnet new classlib -n MyApp.Core dotnet new console -n MyApp.Console dotnet add MyApp.Console reference MyApp.Core @@ -53,7 +53,7 @@ By convention, namespace names follow the folder structure of your project. This :::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: -The .NET SDK supports this convention automatically. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file—but following the convention keeps your codebase predictable. +The .NET SDK supports this convention automatically. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file: but following the convention makes source easier to find. ## Choosing how to split namespaces @@ -61,15 +61,15 @@ Group related types into namespaces by feature or responsibility, not by type ki :::code language="csharp" source="snippets/organizing-programs/Payments.cs" id="FeatureOrganization"::: -Over grouping by type kind (like putting all interfaces in a `MyApp.Interfaces` namespace or all models in `MyApp.Models`). Feature-based organization keeps related types together, making the code easier to navigate and understand. +Over grouping by type kind (like putting all interfaces in a `MyApp.Interfaces`). Feature-based organization keeps related types together, making the code easier to navigate and understand. ## Access modifiers and assemblies -Access modifiers interact with the project/assembly structure to control visibility: +Access modifiers interact with the project/assembly structure to control accessibility: -- `public` — accessible from any assembly that references this one. -- `internal` — accessible only within the same assembly (the default for top-level types). -- `private`, `protected`, `private protected`, `protected internal` — control visibility at the type member level. +- [`public`](../../language-reference/keywords/public.md) — accessible from any assembly that references this one. +- [`internal`](../../language-reference/keywords/internal.md) — accessible only within the same assembly (the default for top-level types). +- [`private`](../../language-reference/keywords/private.md), [`protected`](../../language-reference/keywords/protected.md), [`private protected`](../../language-reference/keywords/private-protected.md), [`protected internal`](../../language-reference/keywords/protected-internal.md) — accessible based on the containing type, the assembly, or derived types. Use `internal` to hide implementation details that other projects shouldn't depend on. This is especially useful for shared libraries: @@ -79,8 +79,8 @@ Use `internal` to hide implementation details that other projects shouldn't depe - **Start simple.** A single project works well for small applications. Split into multiple projects only when you have a clear reason. - **Name namespaces consistently.** Use `CompanyName.ProductName.Feature` as your naming pattern—for example, `Contoso.Inventory.Shipping`. -- **Keep projects focused.** Each project should have a single responsibility. If a project does too many unrelated things, consider splitting it. -- **Use file-scoped namespaces.** The `namespace MyApp.Services;` syntax (C# 10) reduces nesting and is the recommended style for new code. +- **Keep projects focused.** Each project should have a clear responsibility. If a project does too many unrelated things, consider splitting it. +- **Use file-scoped namespaces.** The `namespace MyApp.Services;` syntax reduces nesting and is the recommended style for new code. - **Leverage `global using` directives.** Place common imports in a `GlobalUsings.cs` file to reduce repetition across files. For more information, see [Namespaces and using directives](namespaces.md). ## See also diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md index 665d2a35ec5de..eda6448820108 100644 --- a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -39,7 +39,7 @@ Use `#region` and `#endregion` to mark collapsible sections of code in your edit :::code language="csharp" source="snippets/preprocessor-directives/Regions.cs" id="RegionExample"::: -Regions are helpful in longer files to group related members. Many teams use them to separate fields, properties, constructors, and methods. +Regions can group related members. For example, Regions can define members of an interface when a type implements multiple interfaces. ## Nullable context From a0a5bbb87013a61f70c717bd359d7de6e7b234fa Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 5 Mar 2026 14:37:28 -0500 Subject: [PATCH 07/34] copy edit. --- .../fundamentals/program-structure/index.md | 28 +++++++++---------- .../program-structure/namespaces.md | 18 ++++++------ .../program-structure/organizing-programs.md | 22 +++++++-------- .../preprocessor-directives.md | 14 +++++----- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 497367d4888b7..854a4ee24da0e 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -8,7 +8,7 @@ helpviewer_keywords: --- # General structure of a C# program -A C# program is built from a few core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point—where your program starts running—depends on which application style you choose. +You build C# programs from these core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point - where your program starts running - depends on which application style you choose. The following example shows a modern C# program that uses [file-scoped namespaces](namespaces.md), [top-level statements](top-level-statements.md), and everyday C# features: @@ -18,7 +18,7 @@ This example uses *top-level statements* for the program's entry point. Only one ## Choosing your application style -When you create a C# program, you make two independent choices about how to structure it: +When you create a C# program, make two independent choices about how to structure it: 1. **File-based or project-based?** A file-based app runs from a single `.cs` file with no project file. A project-based app uses a `.csproj` file and can span multiple source files. 1. **Top-level statements or `Main` method?** Top-level statements let you write executable code directly at the top of a file. A `Main` method wraps the entry point in an explicit static method. @@ -27,7 +27,7 @@ Both project-based apps and file-based apps support either entry-point style. ### File-based apps vs. project-based apps -Beginning with C# 14 and .NET 10, *file-based apps* let you run a program contained in a single `*.cs` file without a project file. Store the following code in a file named `hello-world.cs` and run it with `dotnet run hello-world.cs`: +Starting with C# 14 and .NET 10, *file-based apps* let you run a program contained in a single `*.cs` file without a project file. Store the following code in a file named `hello-world.cs` and run it with `dotnet run hello-world.cs`: :::code language="csharp" source="./snippets/file-based-program/hello-world.cs"::: @@ -39,11 +39,11 @@ The `#!` line enables Unix shells to run the file directly. On any Unix system, File-based apps support all C# syntax and can use [preprocessor directives](../../language-reference/preprocessor-directives.md#file-based-apps) to configure the build system. Use file-based apps for small command-line utilities, prototypes, and experiments. -*Project-based apps* use a `.csproj` file and the [.NET CLI commands](../../../core/tools/index.md) `dotnet new`, `dotnet build`, and `dotnet run` workflow. Choose project-based apps when your program spans multiple files, or needs fine-grained build configuration. +*Project-based apps* use a `.csproj` file and the [.NET CLI commands](../../../core/tools/index.md) `dotnet new`, `dotnet build`, and `dotnet run` workflow. Choose project-based apps when your program spans multiple files or needs fine-grained build configuration. ### Top-level statements vs. `Main` method -[Top-level statements](top-level-statements.md) let you write executable code directly in one file, without wrapping it in a class and `Main` method. This is the default style when you create a new console app with `dotnet new console`. The first code example on this page uses this style. +[Top-level statements](top-level-statements.md) let you write executable code directly in one file, without wrapping it in a class and `Main` method. This style is the default when you create a new console app with `dotnet new console`. The first code example in this article uses this style. You can also define an explicit static [`Main`](main-command-line.md) method as the program's entry point: @@ -55,13 +55,13 @@ Either entry-point style works with both file-based and project-based apps. Both C# is a *compiled* language. For project-based apps, use the [`dotnet build`](../../../core/tools/dotnet-build.md) command to compile source files into a binary package and [`dotnet run`](../../../core/tools/dotnet-run.md) to build and run in one step. The `dotnet` CLI, included in the .NET SDK, provides many [tools](../../../core/tools/index.md) to create, build, and manage C# projects. -For file-based apps, `dotnet run hello-world.cs` compiles and runs the single file directly—no project file required. +For file-based apps, `dotnet run hello-world.cs` compiles and runs the single file directly - no project file required. ## Expressions and statements -C# programs are built from *expressions* and *statements*. +C# programs use *expressions* and *statements*. -An *expression* evaluates to a single value. The following are expressions: +An *expression* produces a single value. The following are expressions: - `42` (literal value) - `x + y` (arithmetic operation) @@ -84,12 +84,12 @@ For detailed information about statements, see [Statements](../../programming-gu Learn about these program elements in the [types](../types/index.md) section of the fundamentals guide: -- [Classes](../types/classes.md) -- [Structs](../../language-reference/builtin-types/struct.md) -- [Namespaces](namespaces.md) -- [Interfaces](../types/interfaces.md) -- [Enums](../../language-reference/builtin-types/enum.md) -- [Delegates](../../delegates-overview.md) +- [Classes](../types/classes.md). +- [Structs](../../language-reference/builtin-types/struct.md). +- [Namespaces](namespaces.md). +- [Interfaces](../types/interfaces.md). +- [Enums](../../language-reference/builtin-types/enum.md). +- [Delegates](../../delegates-overview.md). ## C# language specification diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index e77ec8cf2713f..afcb17445a189 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -12,9 +12,9 @@ helpviewer_keywords: --- # Namespaces and using directives -Namespaces organize C# types into logical groups and prevent naming collisions between types that share the same simple name. Every .NET type belongs to a namespace—`System.Console`, `System.Collections.Generic.List`, and `System.Threading.Tasks.Task` are all examples. You encounter namespaces constantly, whether you're consuming .NET libraries or organizing your own code. +Namespaces organize C# types into logical groups and prevent naming collisions between types that share the same simple name. Every .NET type belongs to a namespace. Examples include `System.Console`, `System.Collections.Generic.List`, and `System.Threading.Tasks.Task`. You encounter namespaces constantly, whether you're consuming .NET libraries or organizing your own code. -The following example shows how namespaces work together with `using` directives in a modern C# file: +The following example shows how namespaces work together with `using` directives in a typical C# file: :::code language="csharp" source="snippets/namespaces/Basics.cs" id="NamespaceBasics"::: @@ -32,7 +32,7 @@ For more information, see the [`using` directive](../../language-reference/keywo ## File-scoped namespaces -When you declare your own namespace, use the *file-scoped* syntax (introduced in C# 10). Add a semicolon after the namespace declaration, and it applies to the entire file—no extra braces or indentation needed: +When you declare your own namespace, use the *file-scoped* syntax. Add a semicolon after the namespace declaration, and it applies to the entire file - no extra braces or indentation needed: :::code language="csharp" source="snippets/namespaces/FileScopedExample.cs" id="FileScopedNamespace"::: @@ -47,7 +47,7 @@ The older block-scoped syntax wraps all types in braces. This style is still val ## Global using directives -If you find yourself writing the same `using` directives in every file, *global using* directives (C# 10) let you declare them once for your entire project. Place them in any file—many teams create a dedicated `GlobalUsings.cs` file: +If you write the same `using` directives in every file, *global using* directives let you declare them once for your entire project. Place them in any file - many teams create a dedicated `GlobalUsings.cs` file: :::code language="csharp" source="snippets/namespaces/GlobalUsings.cs" id="GlobalUsings"::: @@ -55,7 +55,7 @@ After declaring a global using, every file in the project can use types from tha ### Implicit usings -The .NET SDK automatically generates global using directives for the most common namespaces based on your project type. Implicit usings are enabled when `enable` is set in your project file. For example, a console app project automatically imports `System`, `System.Collections.Generic`, `System.IO`, `System.Linq`, `System.Threading`, and `System.Threading.Tasks`. The current SDK enables `ImplicitUsings` when you create a new project using `dotnet new`. +The .NET SDK automatically generates global using directives for the most common namespaces based on your project type. Enable implicit usings by setting `enable` in your project file. For example, a console app project automatically imports `System`, `System.Collections.Generic`, `System.IO`, `System.Linq`, `System.Threading`, and `System.Threading.Tasks`. The current SDK enables `ImplicitUsings` when you create a new project by using `dotnet new`. For more information, see [Implicit using directives](../../../core/project-sdk/overview.md#implicit-using-directives). @@ -73,20 +73,20 @@ A `using` alias creates a shorthand name for a type or namespace. Aliases are us :::code language="csharp" source="snippets/namespaces/Aliases.cs" id="TypeAlias"::: -Beginning with C# 12, you can alias any type, including tuples and pointer types: +Starting with C# 12, you can alias any type, including tuples and pointer types: :::code language="csharp" source="snippets/namespaces/TupleAlias.cs" id="AnyTypeAlias"::: -For more advanced scenarios where two assemblies define the same fully qualified type name, you can use [extern alias](../../language-reference/keywords/extern-alias.md) to disambiguate between them. +For more advanced scenarios where two assemblies define the same fully qualified type name, use [extern alias](../../language-reference/keywords/extern-alias.md) to disambiguate between them. ## How namespaces organize code Namespaces have these key properties: - They organize large code projects into logical groups. -- They use the `.` operator to express hierarchy—for example, `System.Collections.Generic`. +- They use the `.` operator to express hierarchy, such as `System.Collections.Generic`. - The `using` directive lets you access types without writing the full namespace path. -- The `global` namespace is the root namespace: `global::System` always refers to the .NET namespace. +- The `global` namespace is the root namespace. `global::System` always refers to the .NET namespace. - Namespace names must be valid C# [identifier names](../coding-style/identifier-names.md). The namespace name typically mirrors the folder structure of your project. For example, types in a `Services/Payments` folder often belong to the `MyApp.Services.Payments` namespace. diff --git a/docs/csharp/fundamentals/program-structure/organizing-programs.md b/docs/csharp/fundamentals/program-structure/organizing-programs.md index 25bc5ead513e3..93a63cea8b5d0 100644 --- a/docs/csharp/fundamentals/program-structure/organizing-programs.md +++ b/docs/csharp/fundamentals/program-structure/organizing-programs.md @@ -15,9 +15,9 @@ As a C# application grows, you need a clear strategy for organizing code. .NET p ## The organizational hierarchy -A typical .NET application is organized in layers, from broadest to most specific: +Organize a typical .NET application in layers, from broadest to most specific: -| Level | What it is | Example | +| Level | Description | Example | |---|---|---| | **Solution** | A container that groups related projects | `MyApp.slnx` | | **Project** | A build unit that produces one assembly | `MyApp.Web.csproj` | @@ -25,7 +25,7 @@ A typical .NET application is organized in layers, from broadest to most specifi | **Namespace** | A logical grouping of types | `MyApp.Web.Controllers` | | **Type** | A class, struct, interface, enum, or delegate | `OrderController` | -Each level serves a different purpose. Solutions organize your development workflow. Projects define what gets compiled together, and each project produces one assembly. Assemblies are the unit of deployment and versioning. Namespaces prevent naming collisions and make types discoverable—a single assembly can contain multiple namespaces, and a single namespace can span multiple assemblies. Types define the actual behavior and data. +Each level serves a different purpose. Solutions organize your development workflow. Projects define what gets compiled together, and each project produces one assembly. Assemblies are the unit of deployment and versioning. Namespaces prevent naming collisions and make types easy to find. A single assembly can contain multiple namespaces, and a single namespace can span multiple assemblies. Types define the actual behavior and data. ## Projects and assemblies @@ -39,7 +39,7 @@ The following project structure demonstrates a common pattern: :::code language="csharp" source="snippets/organizing-programs/AppDemo.cs" id="ProjectStructure"::: -Create and reference projects with the `dotnet` CLI: +Create and reference projects by using the `dotnet` CLI: ```dotnetcli dotnet new classlib -n MyApp.Core @@ -53,7 +53,7 @@ By convention, namespace names follow the folder structure of your project. This :::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: -The .NET SDK supports this convention automatically. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file: but following the convention makes source easier to find. +The .NET SDK supports this convention automatically. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file. However, following the convention makes source easier to find. ## Choosing how to split namespaces @@ -61,24 +61,24 @@ Group related types into namespaces by feature or responsibility, not by type ki :::code language="csharp" source="snippets/organizing-programs/Payments.cs" id="FeatureOrganization"::: -Over grouping by type kind (like putting all interfaces in a `MyApp.Interfaces`). Feature-based organization keeps related types together, making the code easier to navigate and understand. +Avoid grouping by type kind, such as putting all interfaces in a `MyApp.Interfaces` namespace. Feature-based organization keeps related types together, so it's easier to navigate and understand the code. ## Access modifiers and assemblies -Access modifiers interact with the project/assembly structure to control accessibility: +Access modifiers work with the project and assembly structure to control accessibility: -- [`public`](../../language-reference/keywords/public.md) — accessible from any assembly that references this one. +- [`public`](../../language-reference/keywords/public.md) — accessible from any assembly that references this assembly. - [`internal`](../../language-reference/keywords/internal.md) — accessible only within the same assembly (the default for top-level types). - [`private`](../../language-reference/keywords/private.md), [`protected`](../../language-reference/keywords/protected.md), [`private protected`](../../language-reference/keywords/private-protected.md), [`protected internal`](../../language-reference/keywords/protected-internal.md) — accessible based on the containing type, the assembly, or derived types. -Use `internal` to hide implementation details that other projects shouldn't depend on. This is especially useful for shared libraries: +Use `internal` to hide implementation details that other projects shouldn't depend on. This modifier is especially useful for shared libraries: :::code language="csharp" source="snippets/organizing-programs/Inventory.cs" id="AccessModifiers"::: ## Practical tips - **Start simple.** A single project works well for small applications. Split into multiple projects only when you have a clear reason. -- **Name namespaces consistently.** Use `CompanyName.ProductName.Feature` as your naming pattern—for example, `Contoso.Inventory.Shipping`. +- **Name namespaces consistently.** Use `CompanyName.ProductName.Feature` as your naming pattern. For example, use `Contoso.Inventory.Shipping`. - **Keep projects focused.** Each project should have a clear responsibility. If a project does too many unrelated things, consider splitting it. - **Use file-scoped namespaces.** The `namespace MyApp.Services;` syntax reduces nesting and is the recommended style for new code. - **Leverage `global using` directives.** Place common imports in a `GlobalUsings.cs` file to reduce repetition across files. For more information, see [Namespaces and using directives](namespaces.md). @@ -87,4 +87,4 @@ Use `internal` to hide implementation details that other projects shouldn't depe - [Namespaces and using directives](namespaces.md) — declare namespaces, import types with `using`, and configure global usings. - [Assemblies in .NET](../../../standard/assembly/index.md) — learn about assemblies, versioning, and deployment. -- [.NET project SDKs](../../../core/project-sdk/overview.md) — project file settings including `RootNamespace` and `ImplicitUsings`. +- [.NET project SDKs](../../../core/project-sdk/overview.md) — view project file settings including `RootNamespace` and `ImplicitUsings`. diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md index eda6448820108..d4b32bbb2ad0b 100644 --- a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -25,13 +25,13 @@ Use `#if`, `#elif`, `#else`, and `#endif` to include or exclude code based on wh :::code language="csharp" source="snippets/preprocessor-directives/Program.cs" id="ConditionalCompilation"::: -The `DEBUG` symbol is defined when you build in the Debug configuration. You don't need to define it yourself—the build system handles it. Target framework symbols like `NET10_0_OR_GREATER` and `NET8_0_OR_GREATER` let you write code that adapts to different .NET versions in multi-targeting projects. +The build system defines the `DEBUG` symbol when you build in the Debug configuration. You don't need to define it yourself. Target framework symbols like `NET10_0_OR_GREATER` and `NET8_0_OR_GREATER` let you write code that adapts to different .NET versions in multi-targeting projects. -You can combine symbols with logical operators—`&&` (and), `||` (or), and `!` (not): +You can combine symbols with logical operators: `&&` (and), `||` (or), and `!` (not): :::code language="csharp" source="snippets/preprocessor-directives/Program.cs" id="CombinedConditions"::: -Use `#define` at the top of a file to define your own symbols. You can also define symbols project-wide with the `DefineConstants` property in your project file. +Use `#define` at the top of a file to define your own symbols. You can also define symbols for the entire project by using the [`DefineConstants`](../../language-reference/compiler-options/language.md#defineconstants) property in your project file. ## Regions @@ -39,11 +39,11 @@ Use `#region` and `#endregion` to mark collapsible sections of code in your edit :::code language="csharp" source="snippets/preprocessor-directives/Regions.cs" id="RegionExample"::: -Regions can group related members. For example, Regions can define members of an interface when a type implements multiple interfaces. +Use regions to group related members. For example, you might use regions to define members of an interface when a type implements multiple interfaces. ## Nullable context -The `#nullable` directive controls nullable reference type analysis within a file. While you typically enable nullable analysis project-wide in your `.csproj` file with `enable`, the `#nullable` directive lets you fine-tune the setting for specific sections of code: +The `#nullable` directive controls nullable reference type analysis within a file. While you typically enable nullable analysis project-wide in your `.csproj` file by using `enable`, use the `#nullable` directive to fine-tune the setting for specific sections of code: :::code language="csharp" source="snippets/preprocessor-directives/NullableContext.cs" id="NullableDirective"::: @@ -62,11 +62,11 @@ Use `#pragma warning disable` to suppress specific compiler warnings, and `#prag :::code language="csharp" source="snippets/preprocessor-directives/PragmaWarning.cs" id="PragmaWarning"::: > [!TIP] -> Always specify the warning number (like `CS0168`) rather than disabling all warnings. This keeps the suppression targeted and makes it clear *why* a warning is being suppressed. +> Always specify the warning number, such as `CS0168`, rather than disabling all warnings. This approach keeps the suppression targeted and makes it clear *why* a warning is being suppressed. ## File-based app directives -Beginning with C# 14, [file-based apps](index.md) use two additional directives: +Starting with C# 14, [file-based apps](index.md) use two additional directives: - `#!` — the *shebang* line that lets Unix shells run the file directly (for example, `#!/usr/bin/env dotnet run`). - `#:` — build-system directives that configure packages, SDK settings, and other options for single-file programs. From d780ffe0c41051cffec95f37ff4897e546e599b1 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 5 Mar 2026 15:12:37 -0500 Subject: [PATCH 08/34] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../fundamentals/program-structure/preprocessor-directives.md | 2 +- docs/csharp/toc.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md index d4b32bbb2ad0b..76a008a8a3800 100644 --- a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -12,7 +12,7 @@ helpviewer_keywords: --- # Preprocessor directives -C# preprocessor directives are instructions to the compiler that affect compilation without changing your program's run-time behavior. They always start with `#` and must be the only instruction on a line. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, four groups cover the vast majority of everyday use: +C# preprocessor directives tell the compiler what code to include, exclude, or treat differently when it builds your app, which can change the resulting program's run-time behavior. They always start with `#` and must appear as a directive on their own line (ignoring leading whitespace), although you can add a trailing comment after the directive. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, four groups cover the vast majority of everyday use: - **Conditional compilation** (`#if` / `#elif` / `#else` / `#endif`) — include or exclude code based on build configuration or target framework. - **Regions** (`#region` / `#endregion`) — mark collapsible sections in your editor. diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index f292630c2bc03..8bcad49dec6d0 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -37,7 +37,7 @@ items: items: - name: Overview href: fundamentals/program-structure/index.md - - name: Namespaces + - name: Namespaces and using directives href: fundamentals/program-structure/namespaces.md - name: Preprocessor directives href: fundamentals/program-structure/preprocessor-directives.md From 886388297dc07e012d82ddf1021708c7dd4161fb Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 5 Mar 2026 15:17:45 -0500 Subject: [PATCH 09/34] one more formatting bit --- .../program-structure/organizing-programs.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/organizing-programs.md b/docs/csharp/fundamentals/program-structure/organizing-programs.md index 93a63cea8b5d0..554068c2d570b 100644 --- a/docs/csharp/fundamentals/program-structure/organizing-programs.md +++ b/docs/csharp/fundamentals/program-structure/organizing-programs.md @@ -17,13 +17,13 @@ As a C# application grows, you need a clear strategy for organizing code. .NET p Organize a typical .NET application in layers, from broadest to most specific: -| Level | Description | Example | -|---|---|---| -| **Solution** | A container that groups related projects | `MyApp.slnx` | -| **Project** | A build unit that produces one assembly | `MyApp.Web.csproj` | -| **Assembly** | The compiled `.dll` or `.exe` produced by a project | `MyApp.Web.dll` | -| **Namespace** | A logical grouping of types | `MyApp.Web.Controllers` | -| **Type** | A class, struct, interface, enum, or delegate | `OrderController` | +| Level | Description | Example | +|---------------|-----------------------------------------------------|-------------------------| +| **Solution** | A container that groups related projects | `MyApp.slnx` | +| **Project** | A build unit that produces one assembly | `MyApp.Web.csproj` | +| **Assembly** | The compiled `.dll` or `.exe` produced by a project | `MyApp.Web.dll` | +| **Namespace** | A logical grouping of types | `MyApp.Web.Controllers` | +| **Type** | A class, struct, interface, enum, or delegate | `OrderController` | Each level serves a different purpose. Solutions organize your development workflow. Projects define what gets compiled together, and each project produces one assembly. Assemblies are the unit of deployment and versioning. Namespaces prevent naming collisions and make types easy to find. A single assembly can contain multiple namespaces, and a single namespace can span multiple assemblies. Types define the actual behavior and data. From 8a135900cd6b1867f5934aa9754e22f7fc7fa449 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 6 Mar 2026 15:23:46 -0500 Subject: [PATCH 10/34] Read-through and update I made a few editorial changes while doing a final proofread. --- .../csharp/fundamentals/program-structure/index.md | 14 +++++++------- .../fundamentals/program-structure/namespaces.md | 4 +++- .../program-structure/preprocessor-directives.md | 12 ++---------- ...anizing-programs.md => program-organization.md} | 6 +++--- .../program-structure/top-level-statements.md | 8 +++----- docs/csharp/toc.yml | 8 ++++---- 6 files changed, 22 insertions(+), 30 deletions(-) rename docs/csharp/fundamentals/program-structure/{organizing-programs.md => program-organization.md} (92%) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 854a4ee24da0e..cd923b2f9e00b 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -10,7 +10,7 @@ helpviewer_keywords: You build C# programs from these core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point - where your program starts running - depends on which application style you choose. -The following example shows a modern C# program that uses [file-scoped namespaces](namespaces.md), [top-level statements](top-level-statements.md), and everyday C# features: +The following example shows a modern C# program that uses [namespaces](namespaces.md), [top-level statements](top-level-statements.md), and typical C# features: :::code language="csharp" source="snippets/toplevel-structure/Program.cs"::: @@ -84,12 +84,12 @@ For detailed information about statements, see [Statements](../../programming-gu Learn about these program elements in the [types](../types/index.md) section of the fundamentals guide: -- [Classes](../types/classes.md). -- [Structs](../../language-reference/builtin-types/struct.md). -- [Namespaces](namespaces.md). -- [Interfaces](../types/interfaces.md). -- [Enums](../../language-reference/builtin-types/enum.md). -- [Delegates](../../delegates-overview.md). +- [Classes](../types/classes.md) +- [Structs](../../language-reference/builtin-types/struct.md) +- [Namespaces](namespaces.md) +- [Interfaces](../types/interfaces.md) +- [Enums](../../language-reference/builtin-types/enum.md) +- [Delegates](../../delegates-overview.md) ## C# language specification diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index afcb17445a189..e866b3da63567 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -18,6 +18,8 @@ The following example shows how namespaces work together with `using` directives :::code language="csharp" source="snippets/namespaces/Basics.cs" id="NamespaceBasics"::: +In the preceding sample, the `using` directive means you can use the by the name `CultureInfo` without specifying the full name of `System.Globalization.CultureInfo`. The `namespace` directive declares that the `Greeter` class is part of the `MyApp.Services` namespace. Its fully qualified name is `MyApp.Services.Greeter`. + ## Using directives Without a `using` directive, you must refer to every type by its *fully qualified name*: the complete namespace path plus the type name: @@ -43,7 +45,7 @@ The older block-scoped syntax wraps all types in braces. This style is still val :::code language="csharp" source="snippets/namespaces/BlockScoped.cs" id="BlockScopedNamespace"::: > [!TIP] -> Use file-scoped namespaces in new code. Most .NET templates and code analyzers recommend this style. +> Use file-scoped namespaces in new code when all types in the file should be declared in the same samespace. Most .NET templates and code analyzers recommend this style. ## Global using directives diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md index 76a008a8a3800..cd464d428c3de 100644 --- a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -12,12 +12,12 @@ helpviewer_keywords: --- # Preprocessor directives -C# preprocessor directives tell the compiler what code to include, exclude, or treat differently when it builds your app, which can change the resulting program's run-time behavior. They always start with `#` and must appear as a directive on their own line (ignoring leading whitespace), although you can add a trailing comment after the directive. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, four groups cover the vast majority of everyday use: +C# preprocessor directives tell the compiler what code to include, exclude, or treat differently when it builds your app, which can change the resulting program. Preprocessor directives always start with `#` and must appear on their own line (ignoring leading whitespace). You can add a trailing comment after the directive. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, three groups cover the vast majority of everyday use: - **Conditional compilation** (`#if` / `#elif` / `#else` / `#endif`) — include or exclude code based on build configuration or target framework. -- **Regions** (`#region` / `#endregion`) — mark collapsible sections in your editor. - **Nullable context** (`#nullable`) — control nullable reference type analysis at a fine-grained level. - **Warning suppression** (`#pragma warning`) — suppress or restore specific compiler warnings. +- **File-based apps** (`#:`) - configure file-based apps. ## Conditional compilation @@ -33,14 +33,6 @@ You can combine symbols with logical operators: `&&` (and), `||` (or), and `!` ( Use `#define` at the top of a file to define your own symbols. You can also define symbols for the entire project by using the [`DefineConstants`](../../language-reference/compiler-options/language.md#defineconstants) property in your project file. -## Regions - -Use `#region` and `#endregion` to mark collapsible sections of code in your editor. Regions don't affect compilation—they're purely an organizational tool: - -:::code language="csharp" source="snippets/preprocessor-directives/Regions.cs" id="RegionExample"::: - -Use regions to group related members. For example, you might use regions to define members of an interface when a type implements multiple interfaces. - ## Nullable context The `#nullable` directive controls nullable reference type analysis within a file. While you typically enable nullable analysis project-wide in your `.csproj` file by using `enable`, use the `#nullable` directive to fine-tune the setting for specific sections of code: diff --git a/docs/csharp/fundamentals/program-structure/organizing-programs.md b/docs/csharp/fundamentals/program-structure/program-organization.md similarity index 92% rename from docs/csharp/fundamentals/program-structure/organizing-programs.md rename to docs/csharp/fundamentals/program-structure/program-organization.md index 554068c2d570b..765a7fa10b6ae 100644 --- a/docs/csharp/fundamentals/program-structure/organizing-programs.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -1,5 +1,5 @@ --- -title: "Organizing programs" +title: "Program organization" description: Learn how to organize C# programs using solutions, projects, assemblies, namespaces, and types to build maintainable, well-structured applications. ms.date: 03/04/2026 ai-usage: ai-assisted @@ -9,7 +9,7 @@ helpviewer_keywords: - "namespaces [C#], organizing" - "solutions [C#]" --- -# Organizing programs +# Program organization As a C# application grows, you need a clear strategy for organizing code. .NET provides a hierarchy of organizational tools—solutions, projects, assemblies, namespaces, and types—that work together to keep large codebases manageable. @@ -53,7 +53,7 @@ By convention, namespace names follow the folder structure of your project. This :::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: -The .NET SDK supports this convention automatically. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file. However, following the convention makes source easier to find. +The .NET SDK supports this convention. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file. However, following the convention makes source easier to find. ## Choosing how to split namespaces diff --git a/docs/csharp/fundamentals/program-structure/top-level-statements.md b/docs/csharp/fundamentals/program-structure/top-level-statements.md index f79dad8c10a60..b0d7c70b66ac2 100644 --- a/docs/csharp/fundamentals/program-structure/top-level-statements.md +++ b/docs/csharp/fundamentals/program-structure/top-level-statements.md @@ -8,11 +8,9 @@ helpviewer_keywords: --- # Top-level statements - programs without `Main` methods -You don't have to explicitly include a `Main` method in a console application project. Instead, you can use the *top-level statements* feature to minimize the code you have to write. +You can use the *top-level statements* feature to minimize the code you have to write. You don't have to explicitly include a [`Main` method](./main-command-line.md) in a console application project. -Top-level statements allow you to write executable code directly at the root of a file, eliminating the need for wrapping your code in a class or method. -This means you can create programs without the ceremony of a `Program` class and a `Main` method. -In this case, the compiler generates a `Program` class with an entry point method for the application. The name of the generated method isn't `Main`, it's an implementation detail that your code can't reference directly. +Top-level statements allow you to write executable code directly at the root of a file, eliminating the need for wrapping your code in a class or method. This means you can create programs without the ceremony of a `Program` class and a `Main` method. In this case, the compiler generates a `Program` class with an entry point method for the application. The name of the generated method isn't `Main`, it's an implementation detail that your code can't reference directly. Here's a *Program.cs* file that is a complete C# program: @@ -20,7 +18,7 @@ Here's a *Program.cs* file that is a complete C# program: Console.WriteLine("Hello World!"); ``` -Top-level statements let you write simple programs for small utilities such as Azure Functions and GitHub Actions. They also make it simpler for new C# programmers to get started learning and writing code. +Top-level statements let you write simple programs for small utilities such as Azure Functions and GitHub Actions. They provide a natural evolution as file-based apps grow to include more files. The following sections explain the rules on what you can and can't do with top-level statements. diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index 8bcad49dec6d0..3f8c72e769859 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -41,12 +41,12 @@ items: href: fundamentals/program-structure/namespaces.md - name: Preprocessor directives href: fundamentals/program-structure/preprocessor-directives.md - - name: Organizing programs - href: fundamentals/program-structure/organizing-programs.md - - name: Main method - href: fundamentals/program-structure/main-command-line.md + - name: Program organization + href: fundamentals/program-structure/program-organization.md - name: Top-level statements href: fundamentals/program-structure/top-level-statements.md + - name: Main method + href: fundamentals/program-structure/main-command-line.md - name: Type system items: - name: Overview From aec74be00dfcfa3f7aed67f3f9fad0b7c927d4a6 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 11 Mar 2026 11:19:47 -0400 Subject: [PATCH 11/34] Major review of the index Content review of the index.md file. --- .../fundamentals/program-structure/index.md | 78 +++++++++++++------ .../snippets/structure/Program.cs | 18 ----- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index cd923b2f9e00b..76ae97015ed12 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -1,82 +1,112 @@ --- title: "General structure of a C# program" description: Learn how C# programs are structured, including the choice between file-based and project-based apps, top-level statements and Main method entry points, and the building blocks that make up every program. -ms.date: 03/04/2026 +ms.date: 03/11/2026 ai-usage: ai-assisted helpviewer_keywords: - "C# language, program structure" --- # General structure of a C# program -You build C# programs from these core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point - where your program starts running - depends on which application style you choose. +> [!TIP] +> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first. They walk you through writing your first C# programs before you learn about program structure. +> +> **Experienced in another language?** You might want to skim the [Get started](../../tour-of-csharp/tutorials/index.md) section for C#-specific syntax, then come back here. -The following example shows a modern C# program that uses [namespaces](namespaces.md), [top-level statements](top-level-statements.md), and typical C# features: - -:::code language="csharp" source="snippets/toplevel-structure/Program.cs"::: - -This example uses *top-level statements* for the program's entry point. Only one file in a project can have top-level statements, and the entry point is the first line of program text in that file. File-scoped namespaces (the `namespace YourNamespace;` syntax) reduce nesting by applying the namespace to the entire file. +You build C# programs from these core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point depends on which application style you choose. ## Choosing your application style When you create a C# program, make two independent choices about how to structure it: -1. **File-based or project-based?** A file-based app runs from a single `.cs` file with no project file. A project-based app uses a `.csproj` file and can span multiple source files. -1. **Top-level statements or `Main` method?** Top-level statements let you write executable code directly at the top of a file. A `Main` method wraps the entry point in an explicit static method. +- **File-based or project-based?** + - A file-based app runs from a single `.cs` file with no project file. + - A project-based app uses a `.csproj` file and can span multiple source files. +- **Top-level statements or `Main` method?** + - Top-level statements let you write executable code directly at the top of a file. + - A `Main` method wraps the entry point in an explicit static method. Both project-based apps and file-based apps support either entry-point style. ### File-based apps vs. project-based apps -Starting with C# 14 and .NET 10, *file-based apps* let you run a program contained in a single `*.cs` file without a project file. Store the following code in a file named `hello-world.cs` and run it with `dotnet run hello-world.cs`: +Starting with C# 14 and .NET 10, *file-based apps* let you run a program contained in a single `*.cs` file without a project file. Store the following code in a file named `hello-world.cs` and run it with `dotnet run hello-world.cs` or `dotnet hello-world.cs`: :::code language="csharp" source="./snippets/file-based-program/hello-world.cs"::: -The `#!` line enables Unix shells to run the file directly. On any Unix system, set the *execute* (`+x`) permission and run the file from the command line: +> [!NOTE] +> The `#!` line enables Unix shells to run the file directly. On any Unix system, set the *execute* (`+x`) permission and run the file from the command line: + +File-based apps support all C# syntax and can use [preprocessor directives](../../language-reference/preprocessor-directives.md#file-based-apps) to configure the build system. Use file-based apps for small command-line utilities, prototypes, and experiments. A file-based app consists of a single file in a directory: -```bash -./hello-world.cs ``` +my-app/ +└── hello-world.cs +``` + +*Project-based apps* use a `.csproj` file and the [.NET CLI commands](../../../core/tools/index.md) `dotnet new`, `dotnet build`, and `dotnet run` workflow. Choose project-based apps when your program spans multiple files or needs fine-grained build configuration. A project-based app includes a project file alongside one or more source files: -File-based apps support all C# syntax and can use [preprocessor directives](../../language-reference/preprocessor-directives.md#file-based-apps) to configure the build system. Use file-based apps for small command-line utilities, prototypes, and experiments. +``` +my-app/ +├── my-app.csproj +├── Program.cs +├── Models/ +│ └── Person.cs +└── Services/ + └── GreetingService.cs +``` -*Project-based apps* use a `.csproj` file and the [.NET CLI commands](../../../core/tools/index.md) `dotnet new`, `dotnet build`, and `dotnet run` workflow. Choose project-based apps when your program spans multiple files or needs fine-grained build configuration. +If your file-based app grows, you can easily convert it to a project-based app. Run [`dotnet project convert`](../../../core/tools/dotnet-project-convert.md) to generate a project file from your existing source file. + +If you know your app needs multiple source files from the start, begin with a project-based app. You avoid the conversion step and can organize your code into separate files right away. ### Top-level statements vs. `Main` method -[Top-level statements](top-level-statements.md) let you write executable code directly in one file, without wrapping it in a class and `Main` method. This style is the default when you create a new console app with `dotnet new console`. The first code example in this article uses this style. +By using [top-level statements](top-level-statements.md), you can write executable code directly in one file without wrapping it in a class and `Main` method. This style is the default when you create a new console app with `dotnet new console`. The following example shows a modern C# program that uses [top-level statements](top-level-statements.md): + +:::code language="csharp" source="snippets/toplevel-structure/Program.cs"::: + +Only one file in a project can have top-level statements, and the entry point is the first line of program text in that file. As you build larger programs, you include more program elements. You can also define an explicit static [`Main`](main-command-line.md) method as the program's entry point: :::code language="csharp" source="snippets/structure/Program.cs"::: -Either entry-point style works with both file-based and project-based apps. Both styles support the same features. +Both entry-point styles work with file-based and project-based apps. Both styles support the same features. ## Building and running C# programs -C# is a *compiled* language. For project-based apps, use the [`dotnet build`](../../../core/tools/dotnet-build.md) command to compile source files into a binary package and [`dotnet run`](../../../core/tools/dotnet-run.md) to build and run in one step. The `dotnet` CLI, included in the .NET SDK, provides many [tools](../../../core/tools/index.md) to create, build, and manage C# projects. +C# is a *compiled* language. For project-based apps, use the [`dotnet build`](../../../core/tools/dotnet-build.md) command to compile source files into a binary package. Use [`dotnet run`](../../../core/tools/dotnet-run.md) to build and run in one step. The `dotnet` CLI, included in the .NET SDK, provides many [tools](../../../core/tools/index.md) to create, build, and manage C# projects. For file-based apps, `dotnet run hello-world.cs` compiles and runs the single file directly - no project file required. ## Expressions and statements -C# programs use *expressions* and *statements*. +If you followed the [Get started](../../tour-of-csharp/index.md) tutorials, you already wrote expressions and statements. Every line of code you typed was one or the other (or both). Now let's define those terms. -An *expression* produces a single value. The following are expressions: +Expressions and statements are the fundamental building blocks of a C# program. An *expression* produces a value. A *statement* performs an action and typically ends in a semicolon. + +The following are expressions: - `42` (literal value) - `x + y` (arithmetic operation) -- `Math.Max(a, b)` (method call) +- `Math.Max(a, b)` (method call that produces a value) - `condition ? trueValue : falseValue` (conditional expression) - `new Person("John")` (object creation) A *statement* performs an action. Statements control program flow, declare variables, or invoke operations. The following are statements: -- `int x = 42;` (declaration statement) -- `Console.WriteLine("Hello");` (expression statement—wraps a method call expression) +- `int x;` (declaration statement) +- `int x = 42;` (declaration statement with initialization) +- `Console.WriteLine("Hello");` (method call statement) - `if (condition) { /* code */ }` (conditional statement) - `return result;` (return statement) -Some constructs serve both roles. For example, `Math.Max(a, b)` is an expression when used in `int result = Math.Max(a, b);`, but becomes an expression statement when written alone as `Math.Max(a, b);`. +Statements often contain expressions, and expressions can nest inside other expressions. For example, the following declaration statement assigns `f` to the result of an addition expression. That addition expression adds the results of two method call expressions: + +```csharp +var f = Math.Max(a, b) + Math.Max(c, d); +``` For detailed information about statements, see [Statements](../../programming-guide/statements-expressions-operators/statements.md). For information about expression-bodied members, see [Expression-bodied members](../../programming-guide/statements-expressions-operators/expression-bodied-members.md). diff --git a/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs index c633595993c31..4ba1411773bba 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs +++ b/docs/csharp/fundamentals/program-structure/snippets/structure/Program.cs @@ -1,24 +1,6 @@ // A skeleton of a C# program using an explicit Main method namespace YourNamespace; -class YourClass -{ -} - -struct YourStruct -{ -} - -interface IYourInterface -{ -} - -delegate int YourDelegate(); - -enum YourEnum -{ -} - class Program { static void Main(string[] args) From 08ade052aa02ba325da2631a5ef2216d0e629b81 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 11 Mar 2026 15:57:19 -0400 Subject: [PATCH 12/34] Major edit on namespaces --- .../fundamentals/program-structure/index.md | 4 +- .../program-structure/namespaces.md | 65 ++++++++++--------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 76ae97015ed12..d3578fb2bcc7d 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -9,9 +9,9 @@ helpviewer_keywords: # General structure of a C# program > [!TIP] -> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first. They walk you through writing your first C# programs before you learn about program structure. +> **New to developing software?** Start with the [Get started](../tour-of-csharp/tutorials/index.md) tutorials first. They walk you through writing your first C# programs before you learn about program structure. > -> **Experienced in another language?** You might want to skim the [Get started](../../tour-of-csharp/tutorials/index.md) section for C#-specific syntax, then come back here. +> **Experienced in another language?** You might want to skim the [Get started](../tour-of-csharp/tutorials/index.md) section for C#-specific syntax, then come back here. You build C# programs from these core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point depends on which application style you choose. diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index e866b3da63567..775409e65be35 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -12,7 +12,14 @@ helpviewer_keywords: --- # Namespaces and using directives -Namespaces organize C# types into logical groups and prevent naming collisions between types that share the same simple name. Every .NET type belongs to a namespace. Examples include `System.Console`, `System.Collections.Generic.List`, and `System.Threading.Tasks.Task`. You encounter namespaces constantly, whether you're consuming .NET libraries or organizing your own code. +> [!TIP] +> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first. They introduce namespaces and `using` directives as you write your first programs. +> +> **Experienced in another language?** Namespaces in C# work similarly to packages in Java or modules in Python. Skim ahead to the syntax you need. + +Namespace declarations and `using` directives are two sides of the same coin. A namespace declaration puts your types into an organized structure. A namespace groups related types together and prevents naming collisions. A `using` directive lets your program consume those types by their simple names. You don't have to spell out the full namespace path at every use. + +Every .NET type belongs to a namespace. For example, the `System` namespace contains fundamental types like `System.Console` and `System.Math`. The `System.Collections.Generic` namespace groups collection types like `List` and `Dictionary`. The `System.Threading.Tasks` namespace holds `Task` and `ValueTask` for asynchronous programming. A single `using` directive for any of these namespaces lets you refer to all its types by their simple names. You write `List` instead of `System.Collections.Generic.List` everywhere you use it. The following example shows how namespaces work together with `using` directives in a typical C# file: @@ -20,40 +27,48 @@ The following example shows how namespaces work together with `using` directives In the preceding sample, the `using` directive means you can use the by the name `CultureInfo` without specifying the full name of `System.Globalization.CultureInfo`. The `namespace` directive declares that the `Greeter` class is part of the `MyApp.Services` namespace. Its fully qualified name is `MyApp.Services.Greeter`. -## Using directives +## Namespace declarations -Without a `using` directive, you must refer to every type by its *fully qualified name*: the complete namespace path plus the type name: +A namespace declaration assigns your types to a named group. Every type you write should belong to a namespace. The namespace name typically mirrors the folder structure of your project. For example, types in a `Services/Payments` folder often belong to the `MyApp.Services.Payments` namespace. -:::code language="csharp" source="snippets/namespaces/Basics.cs" id="FullyQualifiedName"::: +Namespaces use the `.` operator to express hierarchy, such as `System.Collections.Generic`. The `global` namespace is the root namespace - `global::System` always refers to the .NET namespace. Namespace names must be valid C# [identifier names](../coding-style/identifier-names.md). -A `using` directive at the top of a file imports a namespace so you can use its types by their simple names: +### File-scoped namespaces -:::code language="csharp" source="snippets/namespaces/Basics.cs" id="UsingDirective"::: - -For more information, see the [`using` directive](../../language-reference/keywords/using-directive.md). - -## File-scoped namespaces - -When you declare your own namespace, use the *file-scoped* syntax. Add a semicolon after the namespace declaration, and it applies to the entire file - no extra braces or indentation needed: +Use the *file-scoped* syntax when all types in a file belong to the same namespace. Add a semicolon after the namespace declaration, and it applies to the entire file. You don't need extra braces or indentation: :::code language="csharp" source="snippets/namespaces/FileScopedExample.cs" id="FileScopedNamespace"::: File-scoped namespaces reduce nesting and make files easier to read. You can only have one file-scoped namespace declaration per file. +> [!TIP] +> Use file-scoped namespaces in new code. Most .NET templates and code analyzers recommend this style. + +### Block-scoped namespaces + The older block-scoped syntax wraps all types in braces. This style is still valid but adds an extra level of indentation: :::code language="csharp" source="snippets/namespaces/BlockScoped.cs" id="BlockScopedNamespace"::: -> [!TIP] -> Use file-scoped namespaces in new code when all types in the file should be declared in the same samespace. Most .NET templates and code analyzers recommend this style. +## Using directives + +Without a `using` directive, you must refer to every type by its *fully qualified name*, the complete namespace path plus the type name: + +:::code language="csharp" source="snippets/namespaces/Basics.cs" id="FullyQualifiedName"::: + +A `using` directive at the top of a file imports a namespace so you can use its types by their simple names: + +:::code language="csharp" source="snippets/namespaces/Basics.cs" id="UsingDirective"::: + +For more information, see the [`using` directive](../../language-reference/keywords/using-directive.md). -## Global using directives +### Global using directives -If you write the same `using` directives in every file, *global using* directives let you declare them once for your entire project. Place them in any file - many teams create a dedicated `GlobalUsings.cs` file: +If you write the same `using` directives in every file, *global using* directives let you declare them once for your entire project. Place them in any file. Many teams create a dedicated `GlobalUsings.cs` file: :::code language="csharp" source="snippets/namespaces/GlobalUsings.cs" id="GlobalUsings"::: -After declaring a global using, every file in the project can use types from that namespace without an additional `using` directive. +After declaring a global using, every file in the project can refer to types from that namespace by using simple names without an additional `using` directive. ### Implicit usings @@ -61,7 +76,7 @@ The .NET SDK automatically generates global using directives for the most common For more information, see [Implicit using directives](../../../core/project-sdk/overview.md#implicit-using-directives). -## Static using directives +### Static using directives A `static using` directive imports the static members of a type so you can call them without the type name prefix: @@ -69,7 +84,7 @@ A `static using` directive imports the static members of a type so you can call Static usings work well for utility classes like and that you call frequently. -## Type and namespace aliases +### Type and namespace aliases A `using` alias creates a shorthand name for a type or namespace. Aliases are useful for long generic types, resolving naming conflicts, and improving readability: @@ -81,18 +96,6 @@ Starting with C# 12, you can alias any type, including tuples and pointer types: For more advanced scenarios where two assemblies define the same fully qualified type name, use [extern alias](../../language-reference/keywords/extern-alias.md) to disambiguate between them. -## How namespaces organize code - -Namespaces have these key properties: - -- They organize large code projects into logical groups. -- They use the `.` operator to express hierarchy, such as `System.Collections.Generic`. -- The `using` directive lets you access types without writing the full namespace path. -- The `global` namespace is the root namespace. `global::System` always refers to the .NET namespace. -- Namespace names must be valid C# [identifier names](../coding-style/identifier-names.md). - -The namespace name typically mirrors the folder structure of your project. For example, types in a `Services/Payments` folder often belong to the `MyApp.Services.Payments` namespace. - ## C# language specification For more information, see the [Namespaces](~/_csharpstandard/standard/namespaces.md) section of the [C# language specification](~/_csharpstandard/standard/README.md). From f66c682b3e10d99431bc30cb5eb1a7869e455e6e Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 11 Mar 2026 17:26:18 -0400 Subject: [PATCH 13/34] build errors --- docs/csharp/fundamentals/program-structure/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index d3578fb2bcc7d..0a832bbca450a 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -9,9 +9,9 @@ helpviewer_keywords: # General structure of a C# program > [!TIP] -> **New to developing software?** Start with the [Get started](../tour-of-csharp/tutorials/index.md) tutorials first. They walk you through writing your first C# programs before you learn about program structure. +> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/overview.md) tutorials first. They walk you through writing your first C# programs before you learn about program structure. > -> **Experienced in another language?** You might want to skim the [Get started](../tour-of-csharp/tutorials/index.md) section for C#-specific syntax, then come back here. +> **Experienced in another language?** You might want to skim the [Get started](../../tour-of-csharp/tutorials/overview.md) section for C#-specific syntax, then come back here. You build C# programs from these core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point depends on which application style you choose. @@ -82,7 +82,7 @@ For file-based apps, `dotnet run hello-world.cs` compiles and runs the single fi ## Expressions and statements -If you followed the [Get started](../../tour-of-csharp/index.md) tutorials, you already wrote expressions and statements. Every line of code you typed was one or the other (or both). Now let's define those terms. +If you followed the [Get started](../../tour-of-csharp/overview.md) tutorials, you already wrote expressions and statements. Every line of code you typed was one or the other (or both). Now let's define those terms. Expressions and statements are the fundamental building blocks of a C# program. An *expression* produces a value. A *statement* performs an action and typically ends in a semicolon. From 298e01ceb63c076a97f7cca6f0c6f2749f761820 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 13:57:28 -0400 Subject: [PATCH 14/34] major edit pass on preprocessor --- .../preprocessor-directives.md | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md index cd464d428c3de..75f8f3025bfd8 100644 --- a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -1,23 +1,49 @@ --- title: "Preprocessor directives" description: Learn how to use the most common C# preprocessor directives—conditional compilation, regions, nullable context control, and warning suppression—in everyday development. -ms.date: 03/04/2026 +ms.date: 03/13/2026 ai-usage: ai-assisted -helpviewer_keywords: - - "preprocessor directives [C#]" - - "#if directive [C#]" - - "#region directive [C#]" - - "#nullable directive [C#]" - - "#pragma warning [C#]" --- # Preprocessor directives -C# preprocessor directives tell the compiler what code to include, exclude, or treat differently when it builds your app, which can change the resulting program. Preprocessor directives always start with `#` and must appear on their own line (ignoring leading whitespace). You can add a trailing comment after the directive. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, three groups cover the vast majority of everyday use: +C# preprocessor directives tell the compiler what code to include, exclude, or treat differently when it builds your app. This guidance can change the resulting program. Preprocessor directives always start with `#` and must appear on their own line (ignoring leading whitespace). You can add a trailing comment after the directive. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, three groups cover everyday use: +- **File-based apps** (`#:`) - configure file-based apps. - **Conditional compilation** (`#if` / `#elif` / `#else` / `#endif`) — include or exclude code based on build configuration or target framework. -- **Nullable context** (`#nullable`) — control nullable reference type analysis at a fine-grained level. - **Warning suppression** (`#pragma warning`) — suppress or restore specific compiler warnings. -- **File-based apps** (`#:`) - configure file-based apps. +- **Nullable context** (`#nullable`) — control nullable reference type analysis at a fine-grained level. + +## File-based app directives + +Starting with C# 14, [file-based apps](index.md) use two additional directives: + +- `#!` — the *shebang* line that lets Unix shells run the file directly (for example, `#!/usr/bin/env dotnet run`). +- `#:` — build-system directives that configure packages, SDK settings, and other options for single-file programs. + +Use `#:package` to add a NuGet package. For example, the following file-based app uses the `Spectre.Console` package to render styled output: + +```csharp +#!/usr/bin/env dotnet run +#:package Spectre.Console@* + +AnsiConsole.MarkupLine("[bold green]Hello[/] from a file-based app!"); +``` + +You can specify an exact version with `@`, or use `@*` to pull the latest version. Add multiple `#:package` directives to include more packages: + +```csharp +#:package Serilog@3.1.1 +``` + +Other `#:` directives let you reference projects, set MSBuild properties, or change the SDK: + +```csharp +#:project ../SharedLibrary/SharedLibrary.csproj +#:property PublishAot=false +#:sdk Microsoft.NET.Sdk.Web +``` + +For the full list of directives, see [File-based apps](../../../core/sdk/file-based-apps.md) and the [language reference](../../language-reference/preprocessor-directives.md#file-based-apps). ## Conditional compilation @@ -33,20 +59,6 @@ You can combine symbols with logical operators: `&&` (and), `||` (or), and `!` ( Use `#define` at the top of a file to define your own symbols. You can also define symbols for the entire project by using the [`DefineConstants`](../../language-reference/compiler-options/language.md#defineconstants) property in your project file. -## Nullable context - -The `#nullable` directive controls nullable reference type analysis within a file. While you typically enable nullable analysis project-wide in your `.csproj` file by using `enable`, use the `#nullable` directive to fine-tune the setting for specific sections of code: - -:::code language="csharp" source="snippets/preprocessor-directives/NullableContext.cs" id="NullableDirective"::: - -The three forms are: - -- `#nullable enable` — turn on nullable warnings and annotations. -- `#nullable disable` — turn off nullable warnings and annotations. -- `#nullable restore` — revert to the project-level setting. - -This directive is especially useful when you're incrementally migrating a large codebase to nullable reference types. Enable it file by file or section by section, fixing warnings as you go. - ## Warning suppression Use `#pragma warning disable` to suppress specific compiler warnings, and `#pragma warning restore` to re-enable them. Always scope the suppression as narrowly as possible: @@ -56,16 +68,6 @@ Use `#pragma warning disable` to suppress specific compiler warnings, and `#prag > [!TIP] > Always specify the warning number, such as `CS0168`, rather than disabling all warnings. This approach keeps the suppression targeted and makes it clear *why* a warning is being suppressed. -## File-based app directives - -Starting with C# 14, [file-based apps](index.md) use two additional directives: - -- `#!` — the *shebang* line that lets Unix shells run the file directly (for example, `#!/usr/bin/env dotnet run`). -- `#:` — build-system directives that configure packages, SDK settings, and other options for single-file programs. - -For details on these directives, see [File-based apps](../../../core/sdk/file-based-apps.md) and the [language reference](../../language-reference/preprocessor-directives.md#file-based-apps). - ## See also - [C# preprocessor directives (language reference)](../../language-reference/preprocessor-directives.md) — complete reference for all preprocessor directives. -- [Nullable reference types](../../nullable-references.md) — learn about the nullable reference type system. From 65cd84d731e702af44e22b34e4961e546824f716 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 14:31:45 -0400 Subject: [PATCH 15/34] edit pass --- docs/csharp/fundamentals/program-structure/index.md | 4 ++-- .../program-structure/program-organization.md | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 0a832bbca450a..0be6216712089 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -9,9 +9,9 @@ helpviewer_keywords: # General structure of a C# program > [!TIP] -> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/overview.md) tutorials first. They walk you through writing your first C# programs before you learn about program structure. +> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first. They walk you through writing your first C# programs before you learn about program structure. > -> **Experienced in another language?** You might want to skim the [Get started](../../tour-of-csharp/tutorials/overview.md) section for C#-specific syntax, then come back here. +> **Experienced in another language?** You might want to skim the [Get started](../../tour-of-csharp/tutorials/index.md) section for C#-specific syntax, then come back here. You build C# programs from these core building blocks: namespaces organize your types, types (classes, structs, interfaces, enums, and delegates) define behavior and data, and statements and expressions perform work at run time. The way you structure the entry point depends on which application style you choose. diff --git a/docs/csharp/fundamentals/program-structure/program-organization.md b/docs/csharp/fundamentals/program-structure/program-organization.md index 765a7fa10b6ae..a2c510bfd56e0 100644 --- a/docs/csharp/fundamentals/program-structure/program-organization.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -3,11 +3,6 @@ title: "Program organization" description: Learn how to organize C# programs using solutions, projects, assemblies, namespaces, and types to build maintainable, well-structured applications. ms.date: 03/04/2026 ai-usage: ai-assisted -helpviewer_keywords: - - "C# language, program organization" - - "assemblies [C#]" - - "namespaces [C#], organizing" - - "solutions [C#]" --- # Program organization @@ -29,7 +24,7 @@ Each level serves a different purpose. Solutions organize your development workf ## Projects and assemblies -Each project compiles into a single assembly: a `.dll` (class library) or `.exe` (executable). Split your code into multiple projects when you want to: +Each project compiles into a single assembly: a class library or (executable). Split your code into multiple projects when you want to: - **Separate concerns** — keep your data access, business logic, and presentation layers independent. - **Share code** — create a class library that multiple applications reference. @@ -49,11 +44,11 @@ dotnet add MyApp.Console reference MyApp.Core ## Namespaces mirror folder structure -By convention, namespace names follow the folder structure of your project. This convention makes types easy to find—when you see `MyApp.Services.Payments`, you know to look in the `Services/Payments` folder: +By convention, namespace names follow the folder structure of your project. This convention makes it easy to find types. When you see `MyApp.Services.Payments`, you know to look in the `Services/Payments` folder: :::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: -The .NET SDK supports this convention. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file. However, following the convention makes source easier to find. +The .NET SDK supports this convention. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file. However, following the convention makes it easier to find source files. ## Choosing how to split namespaces From 88a48be0234518db12b6cc8fac9a33c4846acd88 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 16:54:29 -0400 Subject: [PATCH 16/34] Simplify the `Main` article --- .../fundamentals/program-structure/index.md | 4 +- .../program-structure/main-command-line.md | 187 +++--------------- .../program-structure/namespaces.md | 8 +- .../preprocessor-directives.md | 5 + .../program-structure/program-organization.md | 39 ++-- .../top-level-statements-1/Program.cs | 13 -- .../top-level-statements.csproj | 10 - .../program-structure/top-level-statements.md | 48 ++--- 8 files changed, 74 insertions(+), 240 deletions(-) delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 0be6216712089..dfc718518fd57 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -1,10 +1,8 @@ --- title: "General structure of a C# program" description: Learn how C# programs are structured, including the choice between file-based and project-based apps, top-level statements and Main method entry points, and the building blocks that make up every program. -ms.date: 03/11/2026 +ms.date: 03/13/2026 ai-usage: ai-assisted -helpviewer_keywords: - - "C# language, program structure" --- # General structure of a C# program diff --git a/docs/csharp/fundamentals/program-structure/main-command-line.md b/docs/csharp/fundamentals/program-structure/main-command-line.md index a4c6c2400cf64..446f83ee10fc6 100644 --- a/docs/csharp/fundamentals/program-structure/main-command-line.md +++ b/docs/csharp/fundamentals/program-structure/main-command-line.md @@ -1,30 +1,20 @@ --- title: "Main() and command-line arguments" description: Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program. -ms.date: 12/15/2025 -f1_keywords: - - "main_CSharpKeyword" - - "Main" -helpviewer_keywords: - - "Main method [C#]" - - "C# language, command-line arguments" - - "arguments [C#], command-line" - - "command line [C#], arguments" - - "command-line arguments [C#], Main method" +ms.date: 03/13/2026 --- # Main() and command-line arguments -The runtime calls the `Main` method when you start a C# application. The `Main` method is the entry point of a C# application. - -A C# program can have only one entry point. If you have more than one class with a `Main` method, you must use the **StartupObject** compiler option when you compile your program to specify which `Main` method serves as the entry point. For more information, see [**StartupObject** (C# Compiler Options)](../../language-reference/compiler-options/advanced.md#startupobject). The following example displays the number of command line arguments as its first action: - -:::code language="csharp" source="snippets/main-command-line/TestClass.cs"::: +> [!TIP] +> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first. Those tutorials use [top-level statements](top-level-statements.md), which is simpler for new apps. +> +> **Working with an existing codebase?** Many existing applications use an explicit `Main` method. This article explains how it works and how to use it effectively. -You can also use top-level statements in one file as the entry point for your application. Like the `Main` method, top-level statements can [return values](#main-return-values) and access [command-line arguments](#command-line-arguments). For more information, see [Top-level statements](top-level-statements.md). The following example uses a `foreach` loop to display the command-line arguments by using the `args` variable, and at the end of the program returns a success code (`0`): +When you start a C# application, the runtime calls the `Main` method. The `Main` method is the entry point of a C# application. -:::code language="csharp" source="snippets/top-level-statements-1/Program.cs"::: +A C# program can have only one entry point. If you have more than one class with a `Main` method, you must use the **StartupObject** compiler option when you compile your program to specify which `Main` method serves as the entry point. For more information, see [**StartupObject** (C# Compiler Options)](../../language-reference/compiler-options/advanced.md#startupobject). The following example displays the number of command-line arguments as its first action: -Beginning with C# 14, programs can be [*file-based apps*](./index.md#building-and-running-c-programs), where a single file contains the program. You run *file-based apps* by using the command `dotnet `, or by using the `#!/usr/bin/env dotnet run` directive as the first line (Unix shells only). +:::code language="csharp" source="snippets/main-command-line/TestClass.cs"::: ## Overview @@ -34,9 +24,9 @@ Beginning with C# 14, programs can be [*file-based apps*](./index.md#building-an - `Main` can have any [access modifier](../../programming-guide/classes-and-structs/access-modifiers.md). - `Main` can return `void`, `int`, `Task`, or `Task`. - If and only if `Main` returns a `Task` or `Task`, the declaration of `Main` can include the [`async`](../../language-reference/keywords/async.md) modifier. This rule specifically excludes an `async void Main` method. -- You can declare the `Main` method with or without a `string[]` parameter that contains command-line arguments. When using Visual Studio to create Windows applications, you can add the parameter manually or else use the method to obtain the command-line arguments. Parameters are zero-indexed command-line arguments. Unlike C and C++, the name of the program isn't treated as the first command-line argument in the `args` array, but it's the first element of the method. +- You can declare the `Main` method with or without a `string[]` parameter that contains command-line arguments. When you use Visual Studio to create Windows applications, you can add the parameter manually or else use the method to obtain the command-line arguments. Parameters are zero-indexed command-line arguments. Unlike C and C++, the name of the program isn't treated as the first command-line argument in the `args` array, but it's the first element of the method. -The following list shows the most common `Main` declarations: +The following list shows permutations of `Main` declarations: ```csharp static void Main() { } @@ -51,166 +41,49 @@ static async Task Main(string[] args) { } The preceding examples don't specify an access modifier, so they're implicitly `private` by default. You can specify any explicit access modifier. -> [!TIP] -> By using `async` and `Task` or `Task` return types, you simplify program code when console applications need to start and `await` asynchronous operations in `Main`. - -## Main() return values - -You can return an `int` from the `Main` method by defining the method in one of the following ways: - -| `Main` declaration | `Main` method code | -|----------------------------------------------|-----------------------------| -| `static int Main()` | No use of `args` or `await` | -| `static int Main(string[] args)` | Uses `args` but not `await` | -| `static async Task Main()` | Uses `await` but not `args` | -| `static async Task Main(string[] args)` | Uses `args` and `await` | - -If the return value from `Main` isn't used, returning `void` or `Task` allows for slightly simpler code. +The following table summarizes all valid `Main` signatures and when to use each one: -| `Main` declaration | `Main` method code | -|-----------------------------------------|-----------------------------| -| `static void Main()` | No use of `args` or `await` | -| `static void Main(string[] args)` | Uses `args` but not `await` | -| `static async Task Main()` | Uses `await` but not `args` | -| `static async Task Main(string[] args)` | Uses `args` and `await` | +| `Main` declaration | Uses `args` | Uses `await` | Returns exit code | +|----------------------------------------------|-------------|--------------|-------------------| +| `static void Main()` | No | No | No | +| `static int Main()` | No | No | Yes | +| `static void Main(string[] args)` | Yes | No | No | +| `static int Main(string[] args)` | Yes | No | Yes | +| `static async Task Main()` | No | Yes | No | +| `static async Task Main()` | No | Yes | Yes | +| `static async Task Main(string[] args)` | Yes | Yes | No | +| `static async Task Main(string[] args)` | Yes | Yes | Yes | -However, returning `int` or `Task` enables the program to communicate status information to other programs or scripts that invoke the executable file. +Choose the simplest signature that fits your needs. If you don't need command-line arguments, omit the `string[] args` parameter. If you don't need to return an exit code, use `void` or `Task`. If you need to call asynchronous methods, use `async` with a `Task` or `Task` return type. -The following example shows how the exit code for the process can be accessed. +## Main() return values -This example uses [.NET Core](../../../core/introduction.md) command-line tools. If you're unfamiliar with .NET Core command-line tools, you can learn about them in this [get-started article](../../../core/tutorials/create-console-app.md). +When you return `int` or `Task`, your program can send status information to other programs or scripts that run the executable. A return value of `0` usually means success, and a nonzero value means there's an error. -Create a new application by running `dotnet new console`. Modify the `Main` method in *Program.cs* as follows: +The following example returns an exit code: :::code language="csharp" source="snippets/main-command-line/MainReturnValTest.cs"::: -Remember to save this program as *MainReturnValTest.cs*. - -When you execute a program in Windows, the system stores any value returned from the `Main` function in an environment variable. You can retrieve this environment variable by using `ERRORLEVEL` from a batch file, or `$LastExitCode` from PowerShell. - -You can build the application by using the [dotnet CLI](../../../core/tools/dotnet.md) `dotnet build` command. +After running the program, you can check the exit code. In PowerShell, use `$LastExitCode`. In a batch file, use `ERRORLEVEL`. -Next, create a PowerShell script to run the application and display the result. Paste the following code into a text file and save it as `test.ps1` in the folder that contains the project. Run the PowerShell script by typing `test.ps1` at the PowerShell prompt. - -Because the code returns zero, the batch file reports success. However, if you change MainReturnValTest.cs to return a nonzero value and then recompile the program, subsequent execution of the PowerShell script reports failure. - -```powershell -dotnet run -if ($LastExitCode -eq 0) { - Write-Host "Execution succeeded" -} else -{ - Write-Host "Execution Failed" -} -Write-Host "Return value = " $LastExitCode -``` - -```output -Execution succeeded -Return value = 0 -``` - -### Async Main return values - -When you declare an `async` return value for `Main`, the compiler generates the boilerplate code for calling asynchronous methods in `Main`: +If your `Main` method uses `await`, declare it as `async` with a `Task` or `Task` return type: :::code language="csharp" source="snippets/main-arguments/Program.cs" id="AsyncMain"::: -In both examples, the main body of the program is within the body of the `AsyncConsoleWork()` method. - -An advantage of declaring `Main` as `async` is that the compiler always generates the correct code. - -When the application entry point returns a `Task` or `Task`, the compiler generates a new entry point that calls the entry point method declared in the application code. Assuming that this entry point is called `$GeneratedMain`, the compiler generates the following code for these entry points: - -- `static Task Main()` results in the compiler emitting the equivalent of `private static void $GeneratedMain() => Main().GetAwaiter().GetResult();`. -- `static Task Main(string[])` results in the compiler emitting the equivalent of `private static void $GeneratedMain(string[] args) => Main(args).GetAwaiter().GetResult();`. -- `static Task Main()` results in the compiler emitting the equivalent of `private static int $GeneratedMain() => Main().GetAwaiter().GetResult();`. -- `static Task Main(string[])` results in the compiler emitting the equivalent of `private static int $GeneratedMain(string[] args) => Main(args).GetAwaiter().GetResult();`. - -> [!NOTE] -> If the examples use the `async` modifier on the `Main` method, the compiler generates the same code. - ## Command-line arguments -You can send arguments to the `Main` method by defining the method in one of the following ways: - -| `Main` declaration | `Main` method code | -|----------------------------------------------|-----------------------------------------| -| `static void Main(string[] args)` | No return value or `await` | -| `static int Main(string[] args)` | Returns a value but doesn't use `await` | -| `static async Task Main(string[] args)` | Uses `await` but doesn't return a value | -| `static async Task Main(string[] args)` | Return a value and uses `await` | - -If you don't use the arguments, you can omit `args` from the method declaration for slightly simpler code: +Include a `string[] args` parameter in your `Main` declaration to accept command-line arguments. If you don't need them, omit the parameter. The `args` parameter is a array that's never null—if no arguments are provided, its `Length` is zero. -| `Main` declaration | `Main` method code | -|---------------------------------|-----------------------------------------| -| `static void Main()` | No return value or `await` | -| `static int Main()` | Returns a value but doesn't use `await` | -| `static async Task Main()` | Uses `await` but doesn't return a value | -| `static async Task Main()` | Returns a value and uses `await` | - -> [!NOTE] -> You can also use or to access the command-line arguments from any point in a console or Windows Forms application. To enable command-line arguments in the `Main` method declaration in a Windows Forms application, you must manually modify the declaration of `Main`. The code generated by the Windows Forms designer creates `Main` without an input parameter. - -The parameter of the `Main` method is a array that represents the command-line arguments. Usually, you determine whether arguments exist by testing the `Length` property, for example: - -:::code language="csharp" source="snippets/main-command-line/Program.cs" ID="Snippet4"::: - -> [!TIP] -> The `args` array can't be null. So, it's safe to access the `Length` property without null checking. - -You can also convert the string arguments to numeric types by using the class or the `Parse` method. For example, the following statement converts the `string` to a `long` number by using the method: - -```csharp -long num = Int64.Parse(args[0]); -``` - -It's also possible to use the C# type `long`, which aliases `Int64`: +You can convert string arguments to other types by using `Parse` or : ```csharp long num = long.Parse(args[0]); ``` -You can also use the `Convert` class method `ToInt64` to do the same thing: - -```csharp -long num = Convert.ToInt64(s); -``` - -For more information, see and . - > [!TIP] > Parsing command-line arguments can be complex. Consider using the [System.CommandLine](../../../standard/commandline/index.md) library to simplify the process. -The following example shows how to use command-line arguments in a console application. The application takes one argument at run time, converts the argument to an integer, and calculates the factorial of the number. If no arguments are supplied, the application issues a message that explains the correct usage of the program. - -To compile and run the application from a command prompt, follow these steps: - -1. Paste the following code into any text editor, and then save the file as a text file with the name *Factorial.cs*. - - :::code language="csharp" source="./snippets/main-command-line/Factorial.cs"::: - - At the beginning of the `Main` method, the program tests if input arguments weren't supplied by comparing the length of the `args` argument to `0` and displays the help if no arguments are found.
- If arguments are provided (`args.Length` is greater than 0), the program tries to convert the input arguments to numbers. This example throws an exception if the argument isn't a number.
- After factorial is calculated (stored in `result` variable of type `long`), the verbose result is printed depending on the `result` variable. - -1. From the **Start** screen or **Start** menu, open a Visual Studio **Developer Command Prompt** window, and then navigate to the folder that contains the file that you created. - -1. To compile the application, enter the following command: - - `dotnet build` - - If your application has no compilation errors, the build process creates a binary file named *Factorial.dll*. - -1. Enter the following command to calculate the factorial of 3: - - `dotnet run -- 3` - -1. If you enter 3 on the command line as the program's argument, the output reads: `The factorial of 3 is 6.` - -> [!NOTE] -> When running an application in Visual Studio, specify command-line arguments in the [Debug Page, Project Designer](/visualstudio/ide/reference/debug-page-project-designer). +For a working example, see [How to display command-line arguments](../tutorials/how-to-display-command-line-arguments.md). ## C# language specification diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index 775409e65be35..5ec7f237dab26 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -1,14 +1,8 @@ --- title: "Namespaces and using directives" description: Learn how to organize C# code with namespaces, file-scoped namespace declarations, global usings, static usings, and type aliases. -ms.date: 03/04/2026 +ms.date: 03/13/2026 ai-usage: ai-assisted -helpviewer_keywords: - - "C# language, namespaces" - - "namespaces [C#]" - - "using directive [C#]" - - "global using [C#]" - - "file-scoped namespace [C#]" --- # Namespaces and using directives diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md index 75f8f3025bfd8..afe1d24c2ed1a 100644 --- a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -6,6 +6,11 @@ ai-usage: ai-assisted --- # Preprocessor directives +> [!TIP] +> **New to developing software?** You won't need preprocessor directives right away. Focus on the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first and come back here when your projects require conditional compilation or build configuration. +> +> **Experienced in another language?** If you're familiar with `#ifdef` in C/C++ or conditional compilation in other languages, C# preprocessor directives work similarly. Skim ahead to the syntax you need. + C# preprocessor directives tell the compiler what code to include, exclude, or treat differently when it builds your app. This guidance can change the resulting program. Preprocessor directives always start with `#` and must appear on their own line (ignoring leading whitespace). You can add a trailing comment after the directive. While the [language reference](../../language-reference/preprocessor-directives.md) documents all available directives, three groups cover everyday use: - **File-based apps** (`#:`) - configure file-based apps. diff --git a/docs/csharp/fundamentals/program-structure/program-organization.md b/docs/csharp/fundamentals/program-structure/program-organization.md index a2c510bfd56e0..de033b1dd9652 100644 --- a/docs/csharp/fundamentals/program-structure/program-organization.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -1,12 +1,17 @@ --- title: "Program organization" description: Learn how to organize C# programs using solutions, projects, assemblies, namespaces, and types to build maintainable, well-structured applications. -ms.date: 03/04/2026 +ms.date: 03/13/2026 ai-usage: ai-assisted --- # Program organization -As a C# application grows, you need a clear strategy for organizing code. .NET provides a hierarchy of organizational tools—solutions, projects, assemblies, namespaces, and types—that work together to keep large codebases manageable. +> [!TIP] +> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first. You'll learn about program organization naturally as your projects grow. +> +> **Experienced in another language?** If you're familiar with solutions and projects in Visual Studio, or build systems like Maven or Cargo, this article maps those concepts to .NET. + +As a C# application grows, you need to organize the code. .NET provides a hierarchy of organizational tools—solutions, projects, assemblies, namespaces, and types—that work together to keep large codebases manageable. The conventions described here represent broad consensus in the .NET community. You might deviate for specific reasons, but following these conventions makes your code familiar and navigable to other .NET developers. ## The organizational hierarchy @@ -24,12 +29,14 @@ Each level serves a different purpose. Solutions organize your development workf ## Projects and assemblies -Each project compiles into a single assembly: a class library or (executable). Split your code into multiple projects when you want to: +Each project compiles into a single assembly: a class library or executable. Start with a single project for small applications—don't split prematurely. Add projects when you have a concrete reason: - **Separate concerns** — keep your data access, business logic, and presentation layers independent. - **Share code** — create a class library that multiple applications reference. - **Control dependencies** — a project can only use types from projects it explicitly references. +A single project works well for many applications. Resist the urge to create separate projects "just in case." You can always refactor later when the need is clear. + The following project structure demonstrates a common pattern: :::code language="csharp" source="snippets/organizing-programs/AppDemo.cs" id="ProjectStructure"::: @@ -42,21 +49,21 @@ dotnet new console -n MyApp.Console dotnet add MyApp.Console reference MyApp.Core ``` -## Namespaces mirror folder structure +## Match namespaces to folder structure -By convention, namespace names follow the folder structure of your project. This convention makes it easy to find types. When you see `MyApp.Services.Payments`, you know to look in the `Services/Payments` folder: +Namespace names should follow the folder structure of your project. When you see `MyApp.Services.Payments`, you know to look in the `Services/Payments` folder. This convention is so widely followed that violating it actively confuses other developers: :::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: -The .NET SDK supports this convention. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file. However, following the convention makes it easier to find source files. +The .NET SDK supports this convention. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file—but always keep them in sync. -## Choosing how to split namespaces +## Organize namespaces by feature, not by type kind -Group related types into namespaces by feature or responsibility, not by type kind. For example, prefer this organization: +Group related types into namespaces by feature or responsibility. Place an interface, its implementations, and supporting types together: :::code language="csharp" source="snippets/organizing-programs/Payments.cs" id="FeatureOrganization"::: -Avoid grouping by type kind, such as putting all interfaces in a `MyApp.Interfaces` namespace. Feature-based organization keeps related types together, so it's easier to navigate and understand the code. +Feature-based organization keeps everything you need in one place, making the code easier to navigate and reason about. ## Access modifiers and assemblies @@ -66,17 +73,17 @@ Access modifiers work with the project and assembly structure to control accessi - [`internal`](../../language-reference/keywords/internal.md) — accessible only within the same assembly (the default for top-level types). - [`private`](../../language-reference/keywords/private.md), [`protected`](../../language-reference/keywords/protected.md), [`private protected`](../../language-reference/keywords/private-protected.md), [`protected internal`](../../language-reference/keywords/protected-internal.md) — accessible based on the containing type, the assembly, or derived types. -Use `internal` to hide implementation details that other projects shouldn't depend on. This modifier is especially useful for shared libraries: +Default to `internal` for types that other projects don't need. This practice hides implementation details and gives you freedom to refactor without breaking consumers. It's especially important for shared libraries: :::code language="csharp" source="snippets/organizing-programs/Inventory.cs" id="AccessModifiers"::: -## Practical tips +## Recommended practices -- **Start simple.** A single project works well for small applications. Split into multiple projects only when you have a clear reason. -- **Name namespaces consistently.** Use `CompanyName.ProductName.Feature` as your naming pattern. For example, use `Contoso.Inventory.Shipping`. -- **Keep projects focused.** Each project should have a clear responsibility. If a project does too many unrelated things, consider splitting it. -- **Use file-scoped namespaces.** The `namespace MyApp.Services;` syntax reduces nesting and is the recommended style for new code. -- **Leverage `global using` directives.** Place common imports in a `GlobalUsings.cs` file to reduce repetition across files. For more information, see [Namespaces and using directives](namespaces.md). +- **Name namespaces consistently.** Use `CompanyName.ProductName.Feature` as your naming pattern. For example, use `Contoso.Inventory.Shipping`. Consistent naming helps developers find types without searching. +- **Keep projects focused.** Each project should have a single, clear responsibility. When a project handles too many unrelated concerns, split it. +- **Use file-scoped namespaces.** The `namespace MyApp.Services;` syntax reduces indentation and is the recommended style. Use it in all new code. +- **Use `global using` directives.** Place common imports in a `GlobalUsings.cs` file to eliminate repetitive `using` lines across files. For more information, see [Namespaces and using directives](namespaces.md). +- **Default to `internal`.** Only mark types `public` when other assemblies genuinely need them. You can always widen access later; narrowing it is a breaking change. ## See also diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs deleted file mode 100644 index a80ab5b17b984..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text; - -StringBuilder builder = new(); -builder.AppendLine("The following arguments are passed:"); - -foreach (var arg in args) -{ - builder.AppendLine($"Argument={arg}"); -} - -Console.WriteLine(builder.ToString()); - -return 0; diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj deleted file mode 100644 index f704bf4988fa6..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - Exe - net8.0 - enable - enable - - - diff --git a/docs/csharp/fundamentals/program-structure/top-level-statements.md b/docs/csharp/fundamentals/program-structure/top-level-statements.md index b0d7c70b66ac2..0a0e2350f249b 100644 --- a/docs/csharp/fundamentals/program-structure/top-level-statements.md +++ b/docs/csharp/fundamentals/program-structure/top-level-statements.md @@ -1,16 +1,16 @@ --- title: "Top-level statements - programs without Main methods" description: Learn about top-level statements. You can create programs without the ceremony of a Program class and a Main method. -ms.date: 01/12/2026 -helpviewer_keywords: - - "C# language, top-level statements" - - "C# language, Main method" +ms.date: 03/13/2026 --- # Top-level statements - programs without `Main` methods -You can use the *top-level statements* feature to minimize the code you have to write. You don't have to explicitly include a [`Main` method](./main-command-line.md) in a console application project. +> [!TIP] +> **New to developing software?** Start with the [Get started](../../tour-of-csharp/tutorials/index.md) tutorials first. Those tutorials use top-level statements, so you'll already be familiar with the basics. +> +> **Looking for the `Main` method alternative?** See [Main method entry point](main-command-line.md) for the explicit `Main` method approach. -Top-level statements allow you to write executable code directly at the root of a file, eliminating the need for wrapping your code in a class or method. This means you can create programs without the ceremony of a `Program` class and a `Main` method. In this case, the compiler generates a `Program` class with an entry point method for the application. The name of the generated method isn't `Main`, it's an implementation detail that your code can't reference directly. +Use *top-level statements* for new apps. By using top-level statements, you can write executable code directly at the root of a file. Here's a *Program.cs* file that is a complete C# program: @@ -18,61 +18,41 @@ Here's a *Program.cs* file that is a complete C# program: Console.WriteLine("Hello World!"); ``` -Top-level statements let you write simple programs for small utilities such as Azure Functions and GitHub Actions. They provide a natural evolution as file-based apps grow to include more files. +When you create a new console app by using `dotnet new console`, it uses top-level statements by default. They work well for programs of any size - from small utilities and Azure Functions to full applications. If you have an existing application that uses an explicit `Main` method, there's no need to convert it. Both styles compile to equivalent code. The following sections explain the rules on what you can and can't do with top-level statements. -## Only one top-level file - -An application must have only one entry point. A project can have only one file with top-level statements. Putting top-level statements in more than one file in a project results in the following compiler error: - -> CS8802 Only one compilation unit can have top-level statements. - -A project can have any number of source code files that don't have top-level statements. - -## No other entry points - -You can explicitly write a `Main` method, but it can't function as an entry point. The compiler issues the following warning: - -> CS7022 The entry point of the program is global code; ignoring 'Main()' entry point. - -In a project with top-level statements, you can't use the [-main](../../language-reference/compiler-options/advanced.md#startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods. - ## `using` directives -For the single file containing top-level statements, `using` directives must come first in that file, as in this example: +For the single file containing top-level statements, `using` directives must come first in that file, as in the following example: :::code language="csharp" source="snippets/top-level-statements-1/Program.cs"::: -## Global namespace - -Top-level statements are implicitly in the global namespace. - ## Namespaces and type definitions -A file with top-level statements can also contain namespaces and type definitions, but they must come after the top-level statements. For example: +Top-level statements are implicitly in the global namespace. A file with top-level statements can also contain namespaces and type definitions, but they must come after the top-level statements. For example: :::code language="csharp" source="snippets/top-level-statements-2/Program.cs"::: ## `args` -Top-level statements can reference the `args` variable to access any command-line arguments that were entered. The `args` variable is never null but its `Length` is zero if no command-line arguments were provided. For example: +Top-level statements can reference the `args` variable to access any command-line arguments that you enter. The `args` variable is never `null`, but its `Length` is zero if you don't provide any command-line arguments. For example: :::code language="csharp" source="snippets/top-level-statements-3/Program.cs"::: -## `await` +## `await` and exit code Use `await` to call an async method. For example: :::code language="csharp" source="snippets/top-level-statements-4/Program.cs"::: -## Exit code for the process - To return an `int` value when the application ends, use the `return` statement as you would in a `Main` method that returns an `int`. For example: :::code language="csharp" source="snippets/top-level-statements-5/Program.cs"::: -## Implicit entry point method +## Entry point rules + +An application must have only one entry point. A project can have only one file with top-level statements, but it can have any number of source code files that don't have top-level statements. You can explicitly write a `Main` method, but it can't function as an entry point. In a project with top-level statements, you can't use the [-main](../../language-reference/compiler-options/advanced.md#startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods. The compiler generates a method to serve as the program entry point for a project with top-level statements. The signature of the method depends on whether the top-level statements contain the `await` keyword or the `return` statement. The following table shows what the method signature looks like, using the method name `Main` in the table for convenience. From 55cda2ef22fc4ab6323ce6bd9b2ccdc626c35f7f Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 17:03:57 -0400 Subject: [PATCH 17/34] Fix links --- docs/core/compatibility/sdk/6.0/csharp-template-code.md | 2 +- docs/core/tutorials/top-level-templates.md | 2 +- .../cancel-an-async-task-or-a-list-of-tasks.md | 2 +- ...rt-multiple-async-tasks-and-process-them-as-they-complete.md | 2 +- docs/csharp/tutorials/console-teleprompter.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/core/compatibility/sdk/6.0/csharp-template-code.md b/docs/core/compatibility/sdk/6.0/csharp-template-code.md index f6ac1f45d8fac..8c84ec0e1485d 100644 --- a/docs/core/compatibility/sdk/6.0/csharp-template-code.md +++ b/docs/core/compatibility/sdk/6.0/csharp-template-code.md @@ -12,7 +12,7 @@ Starting in .NET 6, the project templates that ship with the .NET SDK use the la - [File-scoped namespaces](https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/file-scoped-namespaces.md) - [Target-typed new expressions](/dotnet/csharp/language-reference/proposals/csharp-9.0/target-typed-new) - [Nullable reference types](../../../../csharp/nullable-references.md) -- [Async Main return values](../../../../csharp/fundamentals/program-structure/main-command-line.md#async-main-return-values) +- [Async Main return values](../../../../csharp/fundamentals/program-structure/main-command-line.md#main-return-values) Some of the latest C# language features are not supported by previous target frameworks, so you might experience issues in the following scenarios: diff --git a/docs/core/tutorials/top-level-templates.md b/docs/core/tutorials/top-level-templates.md index 85abb1fb09cdd..553b762dcb3df 100644 --- a/docs/core/tutorials/top-level-templates.md +++ b/docs/core/tutorials/top-level-templates.md @@ -50,7 +50,7 @@ The features that make the new program simpler are *top-level statements*, *glob The term [*top-level statements*](../../csharp/fundamentals/program-structure/top-level-statements.md) means the compiler generates the class and method elements for your main program. The compiler declares the generated class and entry point method in the global namespace. Look at the code for the new application and imagine that it contains the statements inside the `Main` method generated by earlier templates, but in the global namespace. -Add more statements to the program, just as you add statements to your `Main` method in the traditional style. [Access `args` (command-line arguments)](../../csharp/fundamentals/program-structure/top-level-statements.md#args), [use `await`](../../csharp/fundamentals/program-structure/top-level-statements.md#await), and [set the exit code](../../csharp/fundamentals/program-structure/top-level-statements.md#exit-code-for-the-process). You can even add functions. The compiler creates them as local functions nested inside the generated entry point method. Local functions can't include any access modifiers (for example, `public` or `protected`). +Add more statements to the program, just as you add statements to your `Main` method in the traditional style. [Access `args` (command-line arguments)](../../csharp/fundamentals/program-structure/top-level-statements.md#args), [use `await`](../../csharp/fundamentals/program-structure/top-level-statements.md#await-and-exit-code), and [set the exit code](../../csharp/fundamentals/program-structure/top-level-statements.md#await-and-exit-code). You can even add functions. The compiler creates them as local functions nested inside the generated entry point method. Local functions can't include any access modifiers (for example, `public` or `protected`). Both top-level statements and [implicit `using` directives](#implicit-using-directives) simplify the code that makes up your application. To follow an existing tutorial, add any new statements to the *Program.cs* file generated by the template. Imagine that the statements you write are between the open and closing braces in the `Main` method in the instructions of the tutorial. diff --git a/docs/csharp/asynchronous-programming/cancel-an-async-task-or-a-list-of-tasks.md b/docs/csharp/asynchronous-programming/cancel-an-async-task-or-a-list-of-tasks.md index 28059da54f4f7..e42bce5feb235 100644 --- a/docs/csharp/asynchronous-programming/cancel-an-async-task-or-a-list-of-tasks.md +++ b/docs/csharp/asynchronous-programming/cancel-an-async-task-or-a-list-of-tasks.md @@ -118,7 +118,7 @@ static async Task Main() } ``` -The updated `Main` method is now considered an [Async main](../fundamentals/program-structure/main-command-line.md#async-main-return-values), which allows for an asynchronous entry point into the executable. It writes a few instructional messages to the console, then declares a instance named `cancelTask`, which will read console key strokes. If the Enter key is pressed, a call to is made. This will signal cancellation. Next, the `sumPageSizesTask` variable is assigned from the `SumPageSizesAsync` method. Both tasks are then passed to , which will continue when any of the two tasks have completed. +The updated `Main` method is now considered an [Async main](../fundamentals/program-structure/main-command-line.md#main-return-values), which allows for an asynchronous entry point into the executable. It writes a few instructional messages to the console, then declares a instance named `cancelTask`, which will read console key strokes. If the Enter key is pressed, a call to is made. This will signal cancellation. Next, the `sumPageSizesTask` variable is assigned from the `SumPageSizesAsync` method. Both tasks are then passed to , which will continue when any of the two tasks have completed. The next block of code ensures that the application doesn't exit until the cancellation has been processed. If the first task to complete is the `cancelTask`, the `sumPageSizeTask` is awaited. If it was cancelled, when awaited it throws a . The block catches that exception, and prints a message. diff --git a/docs/csharp/asynchronous-programming/start-multiple-async-tasks-and-process-them-as-they-complete.md b/docs/csharp/asynchronous-programming/start-multiple-async-tasks-and-process-them-as-they-complete.md index 40189bba94946..65ce2539a13fa 100644 --- a/docs/csharp/asynchronous-programming/start-multiple-async-tasks-and-process-them-as-they-complete.md +++ b/docs/csharp/asynchronous-programming/start-multiple-async-tasks-and-process-them-as-they-complete.md @@ -82,7 +82,7 @@ The main entry point into the console application is the `Main` method. Replace static Task Main() => SumPageSizesAsync(); ``` -The updated `Main` method is now considered an [Async main](../fundamentals/program-structure/main-command-line.md#async-main-return-values), which allows for an asynchronous entry point into the executable. It is expressed as a call to `SumPageSizesAsync`. +The updated `Main` method is now considered an [Async main](../fundamentals/program-structure/main-command-line.md#main-return-values), which allows for an asynchronous entry point into the executable. It is expressed as a call to `SumPageSizesAsync`. ## Create the asynchronous sum page sizes method diff --git a/docs/csharp/tutorials/console-teleprompter.md b/docs/csharp/tutorials/console-teleprompter.md index 6f8ea634ad5e2..5cad8bea68fd1 100644 --- a/docs/csharp/tutorials/console-teleprompter.md +++ b/docs/csharp/tutorials/console-teleprompter.md @@ -184,7 +184,7 @@ This requires you to change the `Main` method signature to: static async Task Main(string[] args) ``` -Learn more about the [`async Main` method](../fundamentals/program-structure/main-command-line.md#async-main-return-values) in our fundamentals section. +Learn more about the [`async Main` method](../fundamentals/program-structure/main-command-line.md#main-return-values) in our fundamentals section. Next, you need to write the second asynchronous method to read from the Console and watch for the '<' (less than), '>' (greater than) and 'X' or 'x' keys. Here's the method you add for that task: From 70b50a8506350de3c422fc868c6e274ea30f8197 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 17:07:17 -0400 Subject: [PATCH 18/34] Fix up samples --- .../snippets/main-arguments/main-arguments.csproj | 2 +- .../main-command-line/main-command-line.csproj | 2 +- .../snippets/top-level-statements-1/Program.cs | 13 +++++++++++++ .../top-level-statements.csproj | 10 ++++++++++ .../top-level-statements.csproj | 2 +- .../top-level-statements.csproj | 2 +- .../top-level-statements.csproj | 2 +- .../top-level-statements.csproj | 2 +- 8 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-arguments/main-arguments.csproj b/docs/csharp/fundamentals/program-structure/snippets/main-arguments/main-arguments.csproj index f704bf4988fa6..0ece068f6df1a 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/main-arguments/main-arguments.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/main-arguments/main-arguments.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj index c39b1f8d62483..d57b9788c6700 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable main_command_line diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs new file mode 100644 index 0000000000000..a80ab5b17b984 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/Program.cs @@ -0,0 +1,13 @@ +using System.Text; + +StringBuilder builder = new(); +builder.AppendLine("The following arguments are passed:"); + +foreach (var arg in args) +{ + builder.AppendLine($"Argument={arg}"); +} + +Console.WriteLine(builder.ToString()); + +return 0; diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj new file mode 100644 index 0000000000000..38452f1b41daf --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-1/top-level-statements.csproj @@ -0,0 +1,10 @@ + + + + Exe + net10.0 + enable + enable + + + diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-2/top-level-statements.csproj b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-2/top-level-statements.csproj index 9b8f56f2f11f9..38452f1b41daf 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-2/top-level-statements.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-2/top-level-statements.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-3/top-level-statements.csproj b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-3/top-level-statements.csproj index f704bf4988fa6..0ece068f6df1a 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-3/top-level-statements.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-3/top-level-statements.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-4/top-level-statements.csproj b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-4/top-level-statements.csproj index f704bf4988fa6..0ece068f6df1a 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-4/top-level-statements.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-4/top-level-statements.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable diff --git a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-5/top-level-statements.csproj b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-5/top-level-statements.csproj index f704bf4988fa6..0ece068f6df1a 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-5/top-level-statements.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/top-level-statements-5/top-level-statements.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable From 536097e7f32ccae2ea4318653881f5e2294eec34 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 17:33:06 -0400 Subject: [PATCH 19/34] remove snippets no longer needed --- .../snippets/main-command-line/Factorial.cs | 50 ------------------- .../snippets/main-command-line/Program.cs | 18 ------- .../snippets/organizing-programs/Program.cs | 13 ----- .../NullableContext.cs | 19 ------- .../preprocessor-directives/Regions.cs | 22 -------- 5 files changed, 122 deletions(-) delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs deleted file mode 100644 index 92146997ad4d2..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs +++ /dev/null @@ -1,50 +0,0 @@ -public class Functions -{ - public static long Factorial(int n) - { - // Test for invalid input. - if ((n < 0) || (n > 20)) - { - return -1; - } - - // Calculate the factorial iteratively rather than recursively. - long tempResult = 1; - for (int i = 1; i <= n; i++) - { - tempResult *= i; - } - return tempResult; - } -} - -class MainClass -{ - static int Main(string[] args) - { - if (args.Length == 0) - { - Console.WriteLine("Please enter a numeric argument."); - Console.WriteLine("Usage: Factorial "); - return 1; - } - - int num; - bool test = int.TryParse(args[0], out num); - if (!test) - { - Console.WriteLine("Please enter a numeric argument."); - Console.WriteLine("Usage: Factorial "); - return 1; - } - - long result = Functions.Factorial(num); - - if (result == -1) - Console.WriteLine("Input must be >= 0 and <= 20."); - else - Console.WriteLine($"The Factorial of {num} is {result}."); - - return 0; - } -} diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs deleted file mode 100644 index 3978b76a3ff10..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace main_command_line; - -class Program -{ - static int Main(string[] args) - { - // - if (args.Length == 0) - { - System.Console.WriteLine("Please enter a numeric argument."); - return 1; - } - // - - return 0; - } -} - diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs deleted file mode 100644 index 5414f2195ff12..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -using MyApp.Services; -using MyApp.Payments; -using MyApp.Inventory; - -var service = new OrderService(); -var order = service.CreateOrder("Widget", 3, 9.99m); -Console.WriteLine(service.FormatSummary(order)); - -var processor = new CreditCardProcessor(); -processor.ProcessPayment(order.Total); - -var inventory = new InventoryService(); -Console.WriteLine($"Stock level for Widget: {inventory.GetStockLevel("Widget")}"); diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs deleted file mode 100644 index 441dedfa9e032..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace MyApp.Data; - -// -#nullable enable -class CustomerRepository -{ - // With #nullable enable, the compiler warns if you return null - // without declaring the return type as nullable: - public string? FindCustomerName(int id) - { - if (id == 1) - { - return "Alice"; - } - return null; // No warning — return type is string? - } -} -#nullable restore -// diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs deleted file mode 100644 index 7da1e8a59fa62..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace MyApp.Services; - -class ValidationAndFormatting -{ - // - #region Validation methods - static bool IsValidEmail(string email) => - email.Contains('@') && email.Contains('.'); - - static bool IsValidAge(int age) => - age is > 0 and < 150; - #endregion - - #region Formatting methods - static string FormatName(string first, string last) => - $"{last}, {first}"; - - static string FormatCurrency(decimal amount) => - amount.ToString("C"); - #endregion - // -} From 7bdb76e00f657949b54aef2718ad55bf85dca217 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 17:37:29 -0400 Subject: [PATCH 20/34] fix build --- .../snippets/main-command-line/main-command-line.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj index d57b9788c6700..aae3c02c9caf5 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj @@ -6,7 +6,7 @@ enable enable main_command_line - main_command_line.Program + TestClass From bbf8cffaff44e0fa5fdbc45c0228583d93a9f95c Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 17:41:50 -0400 Subject: [PATCH 21/34] Revert "fix build" This reverts commit 797ea26a779274921913d18a6371062a3d3c7e06. --- .../snippets/main-command-line/main-command-line.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj index aae3c02c9caf5..d57b9788c6700 100644 --- a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj +++ b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/main-command-line.csproj @@ -6,7 +6,7 @@ enable enable main_command_line - TestClass + main_command_line.Program
From acc5dbad62206fdac6f4fff181d7140c5404bad1 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 17:42:02 -0400 Subject: [PATCH 22/34] Revert "remove snippets no longer needed" This reverts commit 6d02366f5e83f2c2698c86c7f7b447680204461d. --- .../snippets/main-command-line/Factorial.cs | 50 +++++++++++++++++++ .../snippets/main-command-line/Program.cs | 18 +++++++ .../snippets/organizing-programs/Program.cs | 13 +++++ .../NullableContext.cs | 19 +++++++ .../preprocessor-directives/Regions.cs | 22 ++++++++ 5 files changed, 122 insertions(+) create mode 100644 docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs create mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs new file mode 100644 index 0000000000000..92146997ad4d2 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs @@ -0,0 +1,50 @@ +public class Functions +{ + public static long Factorial(int n) + { + // Test for invalid input. + if ((n < 0) || (n > 20)) + { + return -1; + } + + // Calculate the factorial iteratively rather than recursively. + long tempResult = 1; + for (int i = 1; i <= n; i++) + { + tempResult *= i; + } + return tempResult; + } +} + +class MainClass +{ + static int Main(string[] args) + { + if (args.Length == 0) + { + Console.WriteLine("Please enter a numeric argument."); + Console.WriteLine("Usage: Factorial "); + return 1; + } + + int num; + bool test = int.TryParse(args[0], out num); + if (!test) + { + Console.WriteLine("Please enter a numeric argument."); + Console.WriteLine("Usage: Factorial "); + return 1; + } + + long result = Functions.Factorial(num); + + if (result == -1) + Console.WriteLine("Input must be >= 0 and <= 20."); + else + Console.WriteLine($"The Factorial of {num} is {result}."); + + return 0; + } +} diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs new file mode 100644 index 0000000000000..3978b76a3ff10 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Program.cs @@ -0,0 +1,18 @@ +namespace main_command_line; + +class Program +{ + static int Main(string[] args) + { + // + if (args.Length == 0) + { + System.Console.WriteLine("Please enter a numeric argument."); + return 1; + } + // + + return 0; + } +} + diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs new file mode 100644 index 0000000000000..5414f2195ff12 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/Program.cs @@ -0,0 +1,13 @@ +using MyApp.Services; +using MyApp.Payments; +using MyApp.Inventory; + +var service = new OrderService(); +var order = service.CreateOrder("Widget", 3, 9.99m); +Console.WriteLine(service.FormatSummary(order)); + +var processor = new CreditCardProcessor(); +processor.ProcessPayment(order.Total); + +var inventory = new InventoryService(); +Console.WriteLine($"Stock level for Widget: {inventory.GetStockLevel("Widget")}"); diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs new file mode 100644 index 0000000000000..441dedfa9e032 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs @@ -0,0 +1,19 @@ +namespace MyApp.Data; + +// +#nullable enable +class CustomerRepository +{ + // With #nullable enable, the compiler warns if you return null + // without declaring the return type as nullable: + public string? FindCustomerName(int id) + { + if (id == 1) + { + return "Alice"; + } + return null; // No warning — return type is string? + } +} +#nullable restore +// diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs new file mode 100644 index 0000000000000..7da1e8a59fa62 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs @@ -0,0 +1,22 @@ +namespace MyApp.Services; + +class ValidationAndFormatting +{ + // + #region Validation methods + static bool IsValidEmail(string email) => + email.Contains('@') && email.Contains('.'); + + static bool IsValidAge(int age) => + age is > 0 and < 150; + #endregion + + #region Formatting methods + static string FormatName(string first, string last) => + $"{last}, {first}"; + + static string FormatCurrency(decimal amount) => + amount.ToString("C"); + #endregion + // +} From 829dae52f32749f4bfc8730eb21b8fbeef98d5c5 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 13 Mar 2026 17:46:34 -0400 Subject: [PATCH 23/34] remove only some files. --- .../snippets/main-command-line/Factorial.cs | 50 ------------------- .../NullableContext.cs | 19 ------- .../preprocessor-directives/Regions.cs | 22 -------- 3 files changed, 91 deletions(-) delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs diff --git a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs b/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs deleted file mode 100644 index 92146997ad4d2..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/main-command-line/Factorial.cs +++ /dev/null @@ -1,50 +0,0 @@ -public class Functions -{ - public static long Factorial(int n) - { - // Test for invalid input. - if ((n < 0) || (n > 20)) - { - return -1; - } - - // Calculate the factorial iteratively rather than recursively. - long tempResult = 1; - for (int i = 1; i <= n; i++) - { - tempResult *= i; - } - return tempResult; - } -} - -class MainClass -{ - static int Main(string[] args) - { - if (args.Length == 0) - { - Console.WriteLine("Please enter a numeric argument."); - Console.WriteLine("Usage: Factorial "); - return 1; - } - - int num; - bool test = int.TryParse(args[0], out num); - if (!test) - { - Console.WriteLine("Please enter a numeric argument."); - Console.WriteLine("Usage: Factorial "); - return 1; - } - - long result = Functions.Factorial(num); - - if (result == -1) - Console.WriteLine("Input must be >= 0 and <= 20."); - else - Console.WriteLine($"The Factorial of {num} is {result}."); - - return 0; - } -} diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs deleted file mode 100644 index 441dedfa9e032..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/NullableContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace MyApp.Data; - -// -#nullable enable -class CustomerRepository -{ - // With #nullable enable, the compiler warns if you return null - // without declaring the return type as nullable: - public string? FindCustomerName(int id) - { - if (id == 1) - { - return "Alice"; - } - return null; // No warning — return type is string? - } -} -#nullable restore -// diff --git a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs b/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs deleted file mode 100644 index 7da1e8a59fa62..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/preprocessor-directives/Regions.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace MyApp.Services; - -class ValidationAndFormatting -{ - // - #region Validation methods - static bool IsValidEmail(string email) => - email.Contains('@') && email.Contains('.'); - - static bool IsValidAge(int age) => - age is > 0 and < 150; - #endregion - - #region Formatting methods - static string FormatName(string first, string last) => - $"{last}, {first}"; - - static string FormatCurrency(decimal amount) => - amount.ToString("C"); - #endregion - // -} From 76d124a4278b9ceee837b89e9678a445182b2596 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Mon, 16 Mar 2026 16:05:07 -0400 Subject: [PATCH 24/34] Update edited articles per templates Apply the current template styles to all impacted articles in this PR. --- docfx.json | 1 + .../fundamentals/program-structure/index.md | 15 +++++++-------- .../program-structure/main-command-line.md | 6 ++++-- .../fundamentals/program-structure/namespaces.md | 10 +++++++--- .../program-structure/preprocessor-directives.md | 13 ++++++++----- .../program-structure/program-organization.md | 13 ++++++++----- .../program-structure/top-level-statements.md | 13 +++++++++---- 7 files changed, 44 insertions(+), 27 deletions(-) diff --git a/docfx.json b/docfx.json index bdbaba30753f1..81e6317284893 100644 --- a/docfx.json +++ b/docfx.json @@ -252,6 +252,7 @@ "docs/core/unmanaged-api/**/*.md": "reference", "docs/core/whats-new/**/*.md": "whats-new", "docs/csharp/advanced-topics/interface-implementation/**.md": "tutorial", + "docs/csharp/fundamentals/program-structure/**.md": "concept-article", "docs/csharp/getting-started/**/*.md": "overview", "docs/csharp/how-to/**/*.md": "how-to", "docs/csharp/language-reference/**/*.md": "language-reference", diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index dfc718518fd57..180664d3488fe 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -1,8 +1,12 @@ --- title: "General structure of a C# program" description: Learn how C# programs are structured, including the choice between file-based and project-based apps, top-level statements and Main method entry points, and the building blocks that make up every program. -ms.date: 03/13/2026 +ms.date: 03/16/2026 +ms.topic: concept-article ai-usage: ai-assisted + +#customer intent: As a C# developer, I want to understand how C# programs are structured so that I can choose the right application style and organize my code effectively. + --- # General structure of a C# program @@ -108,9 +112,7 @@ var f = Math.Max(a, b) + Math.Max(c, d); For detailed information about statements, see [Statements](../../programming-guide/statements-expressions-operators/statements.md). For information about expression-bodied members, see [Expression-bodied members](../../programming-guide/statements-expressions-operators/expression-bodied-members.md). -## Related sections - -Learn about these program elements in the [types](../types/index.md) section of the fundamentals guide: +## Related content - [Classes](../types/classes.md) - [Structs](../../language-reference/builtin-types/struct.md) @@ -118,7 +120,4 @@ Learn about these program elements in the [types](../types/index.md) section of - [Interfaces](../types/interfaces.md) - [Enums](../../language-reference/builtin-types/enum.md) - [Delegates](../../delegates-overview.md) - -## C# language specification - -For more information, see [Basic concepts](~/_csharpstandard/standard/basic-concepts.md) in the [C# Language Specification](~/_csharpstandard/standard/README.md). The language specification is the definitive source for C# syntax and usage. +- [Basic concepts in the C# language specification](~/_csharpstandard/standard/basic-concepts.md) diff --git a/docs/csharp/fundamentals/program-structure/main-command-line.md b/docs/csharp/fundamentals/program-structure/main-command-line.md index 446f83ee10fc6..6165c60414d07 100644 --- a/docs/csharp/fundamentals/program-structure/main-command-line.md +++ b/docs/csharp/fundamentals/program-structure/main-command-line.md @@ -1,7 +1,9 @@ --- title: "Main() and command-line arguments" description: Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program. -ms.date: 03/13/2026 +ms.date: 03/16/2026 +ai-usage: ai-assisted +#customer intent: As a C# developer, I want to understand the Main() method and command-line arguments so that I can define and control the entry point of my application. --- # Main() and command-line arguments @@ -89,7 +91,7 @@ For a working example, see [How to display command-line arguments](../tutorials/ [!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)] -## See also +## Related content - - [How to display command line arguments](../tutorials/how-to-display-command-line-arguments.md) diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index 5ec7f237dab26..267e813c993a2 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -1,8 +1,11 @@ --- title: "Namespaces and using directives" description: Learn how to organize C# code with namespaces, file-scoped namespace declarations, global usings, static usings, and type aliases. -ms.date: 03/13/2026 +ms.date: 03/16/2026 ai-usage: ai-assisted + +#customer intent: As a C# developer, I want to understand namespaces and using directives so that I can organize my types and simplify how I reference them in code. + --- # Namespaces and using directives @@ -90,6 +93,7 @@ Starting with C# 12, you can alias any type, including tuples and pointer types: For more advanced scenarios where two assemblies define the same fully qualified type name, use [extern alias](../../language-reference/keywords/extern-alias.md) to disambiguate between them. -## C# language specification +## Related content -For more information, see the [Namespaces](~/_csharpstandard/standard/namespaces.md) section of the [C# language specification](~/_csharpstandard/standard/README.md). +- [`using` directive (language reference)](../../language-reference/keywords/using-directive.md) +- [Namespaces in the C# language specification](~/_csharpstandard/standard/namespaces.md) diff --git a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md index afe1d24c2ed1a..7411522c0a2f5 100644 --- a/docs/csharp/fundamentals/program-structure/preprocessor-directives.md +++ b/docs/csharp/fundamentals/program-structure/preprocessor-directives.md @@ -1,8 +1,11 @@ --- title: "Preprocessor directives" -description: Learn how to use the most common C# preprocessor directives—conditional compilation, regions, nullable context control, and warning suppression—in everyday development. -ms.date: 03/13/2026 +description: Learn how to use the most common C# preprocessor directives—conditional compilation, regions, and warning suppression—in everyday development. +ms.date: 03/16/2026 ai-usage: ai-assisted + +#customer intent: As a C# developer, I want to understand preprocessor directives so that I can control conditional compilation, configure file-based apps, and manage compiler warnings. + --- # Preprocessor directives @@ -16,7 +19,6 @@ C# preprocessor directives tell the compiler what code to include, exclude, or t - **File-based apps** (`#:`) - configure file-based apps. - **Conditional compilation** (`#if` / `#elif` / `#else` / `#endif`) — include or exclude code based on build configuration or target framework. - **Warning suppression** (`#pragma warning`) — suppress or restore specific compiler warnings. -- **Nullable context** (`#nullable`) — control nullable reference type analysis at a fine-grained level. ## File-based app directives @@ -73,6 +75,7 @@ Use `#pragma warning disable` to suppress specific compiler warnings, and `#prag > [!TIP] > Always specify the warning number, such as `CS0168`, rather than disabling all warnings. This approach keeps the suppression targeted and makes it clear *why* a warning is being suppressed. -## See also +## Related content -- [C# preprocessor directives (language reference)](../../language-reference/preprocessor-directives.md) — complete reference for all preprocessor directives. +- [C# preprocessor directives (language reference)](../../language-reference/preprocessor-directives.md) +- [File-based apps](../../../core/sdk/file-based-apps.md) diff --git a/docs/csharp/fundamentals/program-structure/program-organization.md b/docs/csharp/fundamentals/program-structure/program-organization.md index de033b1dd9652..3ab6550c3f28f 100644 --- a/docs/csharp/fundamentals/program-structure/program-organization.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -1,8 +1,11 @@ --- title: "Program organization" description: Learn how to organize C# programs using solutions, projects, assemblies, namespaces, and types to build maintainable, well-structured applications. -ms.date: 03/13/2026 +ms.date: 03/16/2026 ai-usage: ai-assisted + +#customer intent: As a C# developer, I want to understand how to organize my code using solutions, projects, assemblies, and namespaces so that I can build maintainable applications. + --- # Program organization @@ -85,8 +88,8 @@ Default to `internal` for types that other projects don't need. This practice hi - **Use `global using` directives.** Place common imports in a `GlobalUsings.cs` file to eliminate repetitive `using` lines across files. For more information, see [Namespaces and using directives](namespaces.md). - **Default to `internal`.** Only mark types `public` when other assemblies genuinely need them. You can always widen access later; narrowing it is a breaking change. -## See also +## Related content -- [Namespaces and using directives](namespaces.md) — declare namespaces, import types with `using`, and configure global usings. -- [Assemblies in .NET](../../../standard/assembly/index.md) — learn about assemblies, versioning, and deployment. -- [.NET project SDKs](../../../core/project-sdk/overview.md) — view project file settings including `RootNamespace` and `ImplicitUsings`. +- [Namespaces and using directives](namespaces.md) +- [Assemblies in .NET](../../../standard/assembly/index.md) +- [.NET project SDKs](../../../core/project-sdk/overview.md) diff --git a/docs/csharp/fundamentals/program-structure/top-level-statements.md b/docs/csharp/fundamentals/program-structure/top-level-statements.md index 0a0e2350f249b..860c2241f0ee8 100644 --- a/docs/csharp/fundamentals/program-structure/top-level-statements.md +++ b/docs/csharp/fundamentals/program-structure/top-level-statements.md @@ -1,7 +1,11 @@ --- title: "Top-level statements - programs without Main methods" description: Learn about top-level statements. You can create programs without the ceremony of a Program class and a Main method. -ms.date: 03/13/2026 +ms.date: 03/16/2026 +ai-usage: ai-assisted + +#customer intent: As a C# developer, I want to understand top-level statements so that I can write programs without explicit Main method boilerplate. + --- # Top-level statements - programs without `Main` methods @@ -65,7 +69,8 @@ The compiler generates a method to serve as the program entry point for a projec Starting with C# 14, programs can be [*file-based apps*](./index.md#building-and-running-c-programs), where a single file contains the program. You run *file-based apps* by using the command `dotnet `, or by using the `#!/usr/bin/env dotnet` directive as the first line (Unix shells only). -## C# language specification +## Related content -[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)] -[Feature specification - Top-level statements](~/_csharplang/proposals/csharp-9.0/top-level-statements.md) +- [Main() and command-line arguments](main-command-line.md) +- [General structure of a C# program](index.md) +- [Feature specification - Top-level statements](~/_csharplang/proposals/csharp-9.0/top-level-statements.md) From ac29a01c4537020281abbe28b0c46a0d958d768e Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:46:28 -0400 Subject: [PATCH 25/34] Update docs/csharp/fundamentals/program-structure/index.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- docs/csharp/fundamentals/program-structure/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index 180664d3488fe..b71376c307768 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -37,7 +37,7 @@ Starting with C# 14 and .NET 10, *file-based apps* let you run a program contain :::code language="csharp" source="./snippets/file-based-program/hello-world.cs"::: > [!NOTE] -> The `#!` line enables Unix shells to run the file directly. On any Unix system, set the *execute* (`+x`) permission and run the file from the command line: +> The `#!` line enables Unix shells to run the file directly. On any Unix system, set the *execute* (`+x`) permission and run the file from the command line. File-based apps support all C# syntax and can use [preprocessor directives](../../language-reference/preprocessor-directives.md#file-based-apps) to configure the build system. Use file-based apps for small command-line utilities, prototypes, and experiments. A file-based app consists of a single file in a directory: From 9166ed2cef4fa3b2b97b477e5dc1a0fbcfb30bdb Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:47:34 -0400 Subject: [PATCH 26/34] Update docs/csharp/fundamentals/program-structure/namespaces.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- docs/csharp/fundamentals/program-structure/namespaces.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index 267e813c993a2..a814a53ed3d18 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -43,7 +43,12 @@ File-scoped namespaces reduce nesting and make files easier to read. You can onl ### Block-scoped namespaces -The older block-scoped syntax wraps all types in braces. This style is still valid but adds an extra level of indentation: +Use *block-scoped* syntax when you need to declare more than one namespace in the same file. This style adds an extra level of indentation. + +> [!IMPORTANT] +> It's considered bad-practice to declare more than one namespace in the same file. The more common scenario is to use *file-scoped* namespaces. + +The following snippet is an example of a *block-scoped* namespace: :::code language="csharp" source="snippets/namespaces/BlockScoped.cs" id="BlockScopedNamespace"::: From 77d18d90b778bfb29c602d1ae0b355920939bcd9 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:48:22 -0400 Subject: [PATCH 27/34] Update docs/csharp/fundamentals/program-structure/program-organization.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- .../program-structure/program-organization.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/csharp/fundamentals/program-structure/program-organization.md b/docs/csharp/fundamentals/program-structure/program-organization.md index 3ab6550c3f28f..7fd227950182b 100644 --- a/docs/csharp/fundamentals/program-structure/program-organization.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -20,13 +20,13 @@ As a C# application grows, you need to organize the code. .NET provides a hierar Organize a typical .NET application in layers, from broadest to most specific: -| Level | Description | Example | -|---------------|-----------------------------------------------------|-------------------------| -| **Solution** | A container that groups related projects | `MyApp.slnx` | -| **Project** | A build unit that produces one assembly | `MyApp.Web.csproj` | -| **Assembly** | The compiled `.dll` or `.exe` produced by a project | `MyApp.Web.dll` | -| **Namespace** | A logical grouping of types | `MyApp.Web.Controllers` | -| **Type** | A class, struct, interface, enum, or delegate | `OrderController` | +| Level | Description | Example | +|---------------|------------------------------------------------------|-------------------------| +| **Solution** | A container that groups related projects. | `MyApp.slnx` | +| **Project** | A build unit that produces one assembly. | `MyApp.Web.csproj` | +| **Assembly** | The compiled `.dll` or `.exe` produced by a project. | `MyApp.Web.dll` | +| **Namespace** | A logical grouping of types. | `MyApp.Web.Controllers` | +| **Type** | A class, struct, interface, enum, or delegate. | `OrderController` | Each level serves a different purpose. Solutions organize your development workflow. Projects define what gets compiled together, and each project produces one assembly. Assemblies are the unit of deployment and versioning. Namespaces prevent naming collisions and make types easy to find. A single assembly can contain multiple namespaces, and a single namespace can span multiple assemblies. Types define the actual behavior and data. From 8d4d2aa1d09c04c9ca951feef9cbd63dfec023e3 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:48:47 -0400 Subject: [PATCH 28/34] Update docs/csharp/fundamentals/program-structure/program-organization.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- .../fundamentals/program-structure/program-organization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/program-organization.md b/docs/csharp/fundamentals/program-structure/program-organization.md index 7fd227950182b..1df17e960fe8f 100644 --- a/docs/csharp/fundamentals/program-structure/program-organization.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -54,7 +54,7 @@ dotnet add MyApp.Console reference MyApp.Core ## Match namespaces to folder structure -Namespace names should follow the folder structure of your project. When you see `MyApp.Services.Payments`, you know to look in the `Services/Payments` folder. This convention is so widely followed that violating it actively confuses other developers: +Namespace names should follow the folder structure of your project. When you see the namespace `MyApp.Services.Payments`, you know to look in the `Services/Payments` folder for the source code of the types defined in that namespace. The .NET SDK supports this convention, and it is so widely followed that violating it actively confuses other developers: :::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: From 99df55e85505d43eb2e89d140f5c108f40607fe9 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:49:10 -0400 Subject: [PATCH 29/34] Update docs/csharp/fundamentals/program-structure/program-organization.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- .../program-structure/program-organization.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/program-organization.md b/docs/csharp/fundamentals/program-structure/program-organization.md index 1df17e960fe8f..b4aa32921ceae 100644 --- a/docs/csharp/fundamentals/program-structure/program-organization.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -58,7 +58,18 @@ Namespace names should follow the folder structure of your project. When you see :::code language="csharp" source="snippets/organizing-programs/OrderService.cs" id="NamespaceMirroring"::: -The .NET SDK supports this convention. When you set `` in your project file (or accept the default, which matches the project name), the compiler uses it as the base namespace. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file—but always keep them in sync. +Your root namespace is automatically set to the name of your project file. Types in subfolders don't automatically get sub-namespaces—you declare the namespace explicitly in each file—but always keep them in sync. + +> [!TIP] +> You can change the root namespace by setting `` in your project file. +> +> ```xml +> +> +> MyCompany.MyApp +> +> +> ``` ## Organize namespaces by feature, not by type kind From 62a86d0caccf6a2161172873fac64804d0f7e144 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:49:40 -0400 Subject: [PATCH 30/34] Update docs/csharp/fundamentals/program-structure/main-command-line.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- docs/csharp/fundamentals/program-structure/main-command-line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/main-command-line.md b/docs/csharp/fundamentals/program-structure/main-command-line.md index 6165c60414d07..01913d4e511d4 100644 --- a/docs/csharp/fundamentals/program-structure/main-command-line.md +++ b/docs/csharp/fundamentals/program-structure/main-command-line.md @@ -66,7 +66,7 @@ The following example returns an exit code: :::code language="csharp" source="snippets/main-command-line/MainReturnValTest.cs"::: -After running the program, you can check the exit code. In PowerShell, use `$LastExitCode`. In a batch file, use `ERRORLEVEL`. +After running the program, you can check the exit code. In PowerShell, use `$LastExitCode`. In a batch file or shell script, use `%ERRORLEVEL%`. If your `Main` method uses `await`, declare it as `async` with a `Task` or `Task` return type: From c23f607584217d25b1d55d5fa381424e2ca85fdb Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:50:11 -0400 Subject: [PATCH 31/34] Update docs/csharp/fundamentals/program-structure/top-level-statements.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- .../fundamentals/program-structure/top-level-statements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/top-level-statements.md b/docs/csharp/fundamentals/program-structure/top-level-statements.md index 860c2241f0ee8..47d4cb4a287ab 100644 --- a/docs/csharp/fundamentals/program-structure/top-level-statements.md +++ b/docs/csharp/fundamentals/program-structure/top-level-statements.md @@ -40,7 +40,7 @@ Top-level statements are implicitly in the global namespace. A file with top-lev ## `args` -Top-level statements can reference the `args` variable to access any command-line arguments that you enter. The `args` variable is never `null`, but its `Length` is zero if you don't provide any command-line arguments. For example: +Top-level statements can reference the `args` variable to access any command-line arguments passed to the app when it starts. The `args` variable is never `null`, but its `Length` is zero if no command-line arguments were provided. For example: :::code language="csharp" source="snippets/top-level-statements-3/Program.cs"::: From 58b347a6e154d7e29e7083160104d6224086d1a6 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 13:50:41 -0400 Subject: [PATCH 32/34] Update docs/csharp/fundamentals/program-structure/top-level-statements.md Co-authored-by: Andy (Steve) De George <67293991+adegeo@users.noreply.github.com> --- .../fundamentals/program-structure/top-level-statements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/fundamentals/program-structure/top-level-statements.md b/docs/csharp/fundamentals/program-structure/top-level-statements.md index 47d4cb4a287ab..f2008b5a9f1b1 100644 --- a/docs/csharp/fundamentals/program-structure/top-level-statements.md +++ b/docs/csharp/fundamentals/program-structure/top-level-statements.md @@ -56,7 +56,7 @@ To return an `int` value when the application ends, use the `return` statement a ## Entry point rules -An application must have only one entry point. A project can have only one file with top-level statements, but it can have any number of source code files that don't have top-level statements. You can explicitly write a `Main` method, but it can't function as an entry point. In a project with top-level statements, you can't use the [-main](../../language-reference/compiler-options/advanced.md#startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods. +An application must have only one entry point. A project can have only one file with top-level statements, but it can have any number of source code files that don't have top-level statements. You can explicitly write a `Main` method, but it can't function as an entry point. In a project with top-level statements, you can't use the [`-main`](../../language-reference/compiler-options/advanced.md#startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods. The compiler generates a method to serve as the program entry point for a project with top-level statements. The signature of the method depends on whether the top-level statements contain the `await` keyword or the `return` statement. The following table shows what the method signature looks like, using the method name `Main` in the table for convenience. From 80df4b99c18ac7ddd6145ce0c708397475850e38 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 16:58:41 -0400 Subject: [PATCH 33/34] respond to feedback. --- .../fundamentals/program-structure/index.md | 2 +- .../program-structure/main-command-line.md | 25 +++++++------- .../program-structure/namespaces.md | 12 +++++-- .../program-structure/program-organization.md | 19 ++--------- .../snippets/organizing-programs/AppDemo.cs | 12 ------- .../program-structure/top-level-statements.md | 34 +++++++++---------- .../compiler-messages/async-await-errors.md | 2 +- 7 files changed, 44 insertions(+), 62 deletions(-) delete mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs diff --git a/docs/csharp/fundamentals/program-structure/index.md b/docs/csharp/fundamentals/program-structure/index.md index b71376c307768..d6a34b38d957b 100644 --- a/docs/csharp/fundamentals/program-structure/index.md +++ b/docs/csharp/fundamentals/program-structure/index.md @@ -107,7 +107,7 @@ A *statement* performs an action. Statements control program flow, declare varia Statements often contain expressions, and expressions can nest inside other expressions. For example, the following declaration statement assigns `f` to the result of an addition expression. That addition expression adds the results of two method call expressions: ```csharp -var f = Math.Max(a, b) + Math.Max(c, d); +var maxResult = Math.Max(a, b) + Math.Max(c, d); ``` For detailed information about statements, see [Statements](../../programming-guide/statements-expressions-operators/statements.md). For information about expression-bodied members, see [Expression-bodied members](../../programming-guide/statements-expressions-operators/expression-bodied-members.md). diff --git a/docs/csharp/fundamentals/program-structure/main-command-line.md b/docs/csharp/fundamentals/program-structure/main-command-line.md index 01913d4e511d4..4e7350f5c92e9 100644 --- a/docs/csharp/fundamentals/program-structure/main-command-line.md +++ b/docs/csharp/fundamentals/program-structure/main-command-line.md @@ -20,7 +20,8 @@ A C# program can have only one entry point. If you have more than one class with ## Overview -- The `Main` method is the entry point of an executable program. It's where the program control starts and ends. +The `Main` method is the entry point of an executable program. When your program starts, the runtime calls `Main` before any other code runs. When `Main` returns, the program ends. You declare `Main` with these rules: + - You must declare `Main` inside a class or struct. The enclosing `class` can be `static`. - `Main` must be [`static`](../../language-reference/keywords/static.md). - `Main` can have any [access modifier](../../programming-guide/classes-and-structs/access-modifiers.md). @@ -45,16 +46,16 @@ The preceding examples don't specify an access modifier, so they're implicitly ` The following table summarizes all valid `Main` signatures and when to use each one: -| `Main` declaration | Uses `args` | Uses `await` | Returns exit code | -|----------------------------------------------|-------------|--------------|-------------------| -| `static void Main()` | No | No | No | -| `static int Main()` | No | No | Yes | -| `static void Main(string[] args)` | Yes | No | No | -| `static int Main(string[] args)` | Yes | No | Yes | -| `static async Task Main()` | No | Yes | No | -| `static async Task Main()` | No | Yes | Yes | -| `static async Task Main(string[] args)` | Yes | Yes | No | -| `static async Task Main(string[] args)` | Yes | Yes | Yes | +| `Main` declaration | Uses `args` | contains `await` | Returns exit code | +|----------------------------------------------|-------------|------------------|-------------------| +| `static void Main()` | No | No | No | +| `static int Main()` | No | No | Yes | +| `static void Main(string[] args)` | Yes | No | No | +| `static int Main(string[] args)` | Yes | No | Yes | +| `static async Task Main()` | No | Yes | No | +| `static async Task Main()` | No | Yes | Yes | +| `static async Task Main(string[] args)` | Yes | Yes | No | +| `static async Task Main(string[] args)` | Yes | Yes | Yes | Choose the simplest signature that fits your needs. If you don't need command-line arguments, omit the `string[] args` parameter. If you don't need to return an exit code, use `void` or `Task`. If you need to call asynchronous methods, use `async` with a `Task` or `Task` return type. @@ -68,7 +69,7 @@ The following example returns an exit code: After running the program, you can check the exit code. In PowerShell, use `$LastExitCode`. In a batch file or shell script, use `%ERRORLEVEL%`. -If your `Main` method uses `await`, declare it as `async` with a `Task` or `Task` return type: +If your `Main` method uses `await`, declare it as `async` with a `Task` or `Task` return type. The runtime calls `Main` and waits for the returned `Task` to complete before the process exits. The return type can't be `void` or `int` because the `async` modifier requires a return type that the runtime can await—`void` and `int` don't represent ongoing work, so the process could exit before asynchronous operations finish. Use `Task` when you don't need an exit code, or `Task` when you do: :::code language="csharp" source="snippets/main-arguments/Program.cs" id="AsyncMain"::: diff --git a/docs/csharp/fundamentals/program-structure/namespaces.md b/docs/csharp/fundamentals/program-structure/namespaces.md index a814a53ed3d18..7ca3f6f2a5432 100644 --- a/docs/csharp/fundamentals/program-structure/namespaces.md +++ b/docs/csharp/fundamentals/program-structure/namespaces.md @@ -14,9 +14,15 @@ ai-usage: ai-assisted > > **Experienced in another language?** Namespaces in C# work similarly to packages in Java or modules in Python. Skim ahead to the syntax you need. -Namespace declarations and `using` directives are two sides of the same coin. A namespace declaration puts your types into an organized structure. A namespace groups related types together and prevents naming collisions. A `using` directive lets your program consume those types by their simple names. You don't have to spell out the full namespace path at every use. +Namespace declarations and `using` directives are related language features. A namespace declaration puts your types into an organized structure. A namespace groups related types together and prevents naming collisions. A `using` directive lets your program consume those types by their simple names. You don't have to spell out the full namespace path at every use. -Every .NET type belongs to a namespace. For example, the `System` namespace contains fundamental types like `System.Console` and `System.Math`. The `System.Collections.Generic` namespace groups collection types like `List` and `Dictionary`. The `System.Threading.Tasks` namespace holds `Task` and `ValueTask` for asynchronous programming. A single `using` directive for any of these namespaces lets you refer to all its types by their simple names. You write `List` instead of `System.Collections.Generic.List` everywhere you use it. +You've already used namespaces in every C# program you've written. Every .NET type belongs to a namespace, and every `using` directive at the top of a file references one. For example, `Console` and `Math` belong to the `System` namespace, so their fully qualified names are `System.Console` and `System.Math`. Collection types like `List` and `Dictionary` belong to `System.Collections.Generic`. A single `using` directive for any of these namespaces lets you refer to all its types by their simple names. You write `List` instead of `System.Collections.Generic.List` everywhere you use it. + +This article provides more background on how namespaces and `using` directives work, and shows examples of patterns you've already encountered in .NET libraries. + +A namespace contains types. Every .NET type belongs to a namespace. For example, consider `System.Threading.Tasks.Task`: the type `Task` belongs to the `System.Threading.Tasks` namespace. + +It's good practice to group related or similar types in the same namespace, and that's what .NET does with the types it provides. The `System.Collections.Generic` namespace contains collection-related types and the `System.IO` namespace contains types related reading and writing files, directories, and data. The `System` namespace contains fundamental types like `Math`, `DateTime`, and `Console`. The following example shows how namespaces work together with `using` directives in a typical C# file: @@ -28,7 +34,7 @@ In the preceding sample, the `using` directive means you can use the namespace. Namespace names must be valid C# [identifier names](../coding-style/identifier-names.md). +Namespaces use the `.` operator to express hierarchy, such as `System.Collections.Generic`. Namespace names must be valid C# [identifier names](../coding-style/identifier-names.md). ### File-scoped namespaces diff --git a/docs/csharp/fundamentals/program-structure/program-organization.md b/docs/csharp/fundamentals/program-structure/program-organization.md index b4aa32921ceae..1b3a6fa0b0640 100644 --- a/docs/csharp/fundamentals/program-structure/program-organization.md +++ b/docs/csharp/fundamentals/program-structure/program-organization.md @@ -32,25 +32,13 @@ Each level serves a different purpose. Solutions organize your development workf ## Projects and assemblies -Each project compiles into a single assembly: a class library or executable. Start with a single project for small applications—don't split prematurely. Add projects when you have a concrete reason: +Each project compiles into a single assembly: a class library or executable. Start with a single project for small applications—don't split prematurely. The primary reason to create a separate project is to reuse that code in more than one application. Beyond reuse, add projects when you have a concrete reason: +- **Share code across applications** — extract shared logic into a class library that multiple apps reference. - **Separate concerns** — keep your data access, business logic, and presentation layers independent. -- **Share code** — create a class library that multiple applications reference. - **Control dependencies** — a project can only use types from projects it explicitly references. -A single project works well for many applications. Resist the urge to create separate projects "just in case." You can always refactor later when the need is clear. - -The following project structure demonstrates a common pattern: - -:::code language="csharp" source="snippets/organizing-programs/AppDemo.cs" id="ProjectStructure"::: - -Create and reference projects by using the `dotnet` CLI: - -```dotnetcli -dotnet new classlib -n MyApp.Core -dotnet new console -n MyApp.Console -dotnet add MyApp.Console reference MyApp.Core -``` +A single project works well for many applications. Resist the urge to create separate projects "just in case." You can always extract a library later when a second application needs the same code. ## Match namespaces to folder structure @@ -96,7 +84,6 @@ Default to `internal` for types that other projects don't need. This practice hi - **Name namespaces consistently.** Use `CompanyName.ProductName.Feature` as your naming pattern. For example, use `Contoso.Inventory.Shipping`. Consistent naming helps developers find types without searching. - **Keep projects focused.** Each project should have a single, clear responsibility. When a project handles too many unrelated concerns, split it. - **Use file-scoped namespaces.** The `namespace MyApp.Services;` syntax reduces indentation and is the recommended style. Use it in all new code. -- **Use `global using` directives.** Place common imports in a `GlobalUsings.cs` file to eliminate repetitive `using` lines across files. For more information, see [Namespaces and using directives](namespaces.md). - **Default to `internal`.** Only mark types `public` when other assemblies genuinely need them. You can always widen access later; narrowing it is a breaking change. ## Related content diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs deleted file mode 100644 index ef42ada3b3d23..0000000000000 --- a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs +++ /dev/null @@ -1,12 +0,0 @@ -// -// MyApp.Core (class library) — shared business logic -namespace MyApp.Core; - -public class Order -{ - public required string ProductName { get; init; } - public int Quantity { get; init; } - public decimal UnitPrice { get; init; } - public decimal Total => Quantity * UnitPrice; -} -// diff --git a/docs/csharp/fundamentals/program-structure/top-level-statements.md b/docs/csharp/fundamentals/program-structure/top-level-statements.md index f2008b5a9f1b1..e4032385027c9 100644 --- a/docs/csharp/fundamentals/program-structure/top-level-statements.md +++ b/docs/csharp/fundamentals/program-structure/top-level-statements.md @@ -26,6 +26,21 @@ When you create a new console app by using `dotnet new console`, it uses top-lev The following sections explain the rules on what you can and can't do with top-level statements. +## Entry point rules + +An application must have only one entry point. A project can have only one file with top-level statements, but it can have any number of source code files that don't have top-level statements. You can explicitly write a `Main` method, but it can't function as an entry point. In a project with top-level statements, you can't use the [`-main`](../../language-reference/compiler-options/advanced.md#startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods. + +The compiler generates a method to serve as the program entry point for a project with top-level statements. The signature of the method depends on whether the top-level statements contain the `await` keyword or the `return` statement. The following table shows what the method signature looks like, using the method name `Main` in the table for convenience. + +| Top-level code contains | Implicit `Main` signature | +|-------------------------|----------------------------------------------| +| `await` and `return` | `static async Task Main(string[] args)` | +| `await` | `static async Task Main(string[] args)` | +| `return` | `static int Main(string[] args)` | +| No `await` or `return` | `static void Main(string[] args)` | + +Starting with C# 14, programs can be [*file-based apps*](./index.md#building-and-running-c-programs), where a single file contains the program. You run *file-based apps* by using the command `dotnet `, or by using the `#!/usr/bin/env dotnet` directive as the first line (Unix shells only). + ## `using` directives For the single file containing top-level statements, `using` directives must come first in that file, as in the following example: @@ -46,29 +61,14 @@ Top-level statements can reference the `args` variable to access any command-lin ## `await` and exit code -Use `await` to call an async method. For example: +Use `await` to call an async method. When your top-level code contains `await`, the compiler generates an entry point that returns a `Task`. The runtime monitors that `Task` for completion, keeping the process alive until all asynchronous work finishes. For example: :::code language="csharp" source="snippets/top-level-statements-4/Program.cs"::: -To return an `int` value when the application ends, use the `return` statement as you would in a `Main` method that returns an `int`. For example: +To return an exit code when the application ends, use the `return` statement. The compiler generates an entry point that returns `Task` when your code contains both `await` and `return`, or `int` when it contains only `return`. For example: :::code language="csharp" source="snippets/top-level-statements-5/Program.cs"::: -## Entry point rules - -An application must have only one entry point. A project can have only one file with top-level statements, but it can have any number of source code files that don't have top-level statements. You can explicitly write a `Main` method, but it can't function as an entry point. In a project with top-level statements, you can't use the [`-main`](../../language-reference/compiler-options/advanced.md#startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods. - -The compiler generates a method to serve as the program entry point for a project with top-level statements. The signature of the method depends on whether the top-level statements contain the `await` keyword or the `return` statement. The following table shows what the method signature looks like, using the method name `Main` in the table for convenience. - -| Top-level code contains | Implicit `Main` signature | -|-------------------------|----------------------------------------------| -| `await` and `return` | `static async Task Main(string[] args)` | -| `await` | `static async Task Main(string[] args)` | -| `return` | `static int Main(string[] args)` | -| No `await` or `return` | `static void Main(string[] args)` | - -Starting with C# 14, programs can be [*file-based apps*](./index.md#building-and-running-c-programs), where a single file contains the program. You run *file-based apps* by using the command `dotnet `, or by using the `#!/usr/bin/env dotnet` directive as the first line (Unix shells only). - ## Related content - [Main() and command-line arguments](main-command-line.md) diff --git a/docs/csharp/language-reference/compiler-messages/async-await-errors.md b/docs/csharp/language-reference/compiler-messages/async-await-errors.md index 68613fe90746a..643d9d35f6db0 100644 --- a/docs/csharp/language-reference/compiler-messages/async-await-errors.md +++ b/docs/csharp/language-reference/compiler-messages/async-await-errors.md @@ -203,7 +203,7 @@ The following items explain how to correct each error. For more information abou - Change the return expression to match the async method's underlying result type (**CS1983**, **CS4016**). When an async method returns `Task`, the `return` statement must supply a value of type `T`, not `Task`, because the compiler-generated [state machine](../../asynchronous-programming/task-asynchronous-programming-model.md) wraps the value in a task automatically. **CS1983** appears when the method returns `Task` and the expression is `T`; **CS4016** covers the general case where the return expression type doesn't match. - Remove the [`async`](../keywords/async.md) modifier from methods that don't have a body, such as abstract methods or interface method declarations (**CS1994**). The `async` modifier requires a method body so the compiler can generate the state machine implementation. -- Change an async entry point's return type to or (**CS4009**). Starting with C# 7.1, the [`Main` method](../../fundamentals/program-structure/main-command-line.md#async-main-return-values) can be `async`, but it must return `Task` or `Task` - `async void` and `async int` aren't valid entry point signatures. +- Change an async entry point's return type to or (**CS4009**). Starting with C# 7.1, the [`Main` method](../../fundamentals/program-structure/main-command-line.md#main-return-values) can be `async`, but it must return `Task` or `Task` - `async void` and `async int` aren't valid entry point signatures. - Remove or rename one entry point when the project contains both a synchronous and an asynchronous `Main` method (**CS8892**). The compiler selects the synchronous entry point and issues this warning for the async candidate that it ignores. - Add an explicit return type to the lambda expression before applying the [`[AsyncMethodBuilder]`](xref:System.Runtime.CompilerServices.AsyncMethodBuilderAttribute) attribute (**CS8935**). The compiler can't resolve the builder type for an anonymous method whose return type is inferred, because the attribute must be matched to a specific return type at compile time. - Change the type specified in the [`[AsyncMethodBuilder]`](xref:System.Runtime.CompilerServices.AsyncMethodBuilderAttribute) attribute to an unbound generic type of arity one, such as `MyTaskMethodBuilder<>` rather than `MyTaskMethodBuilder` or a non-generic type (**CS8940**). The builder's containing type, if any, must also be non-generic. The compiler requires this shape so it can construct the builder for any concrete task-like return type. From e09c0e3cad4cf6b5e924591af30e2a5636c36046 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 19 Mar 2026 17:18:05 -0400 Subject: [PATCH 34/34] Add necessary file --- .../snippets/organizing-programs/AppDemo.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs diff --git a/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs new file mode 100644 index 0000000000000..50e96328fd567 --- /dev/null +++ b/docs/csharp/fundamentals/program-structure/snippets/organizing-programs/AppDemo.cs @@ -0,0 +1,12 @@ +// +// MyApp.Core (class library) — shared business logic +namespace MyApp.Core; + +public class Order +{ + public required string ProductName { get; init; } + public int Quantity { get; init; } + public decimal UnitPrice { get; init; } + public decimal Total => Quantity * UnitPrice; +} +// \ No newline at end of file