Skip to content

Commit 339291c

Browse files
committed
Remove "What's new in C# 10"
Remove references to "Beginning in C# 10", and the "What's new in C# 10" article.
1 parent d2d91be commit 339291c

38 files changed

+108
-291
lines changed

docs/core/tutorials/top-level-templates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "C# console app template changes in .NET 6+"
33
description: The .NET 6+ project template for C# console apps uses top-level statements. Understand what changed and how to use existing learning materials with the new syntax.
4-
ms.date: 03/15/2024
4+
ms.date: 11/22/2024
55
---
66
# C# console app template generates top-level statements
77

@@ -34,7 +34,7 @@ namespace MyApp
3434

3535
In the preceding code, the actual namespace depends on the project name.
3636

37-
These two forms represent the same program. Both are valid with C# 10.0. When you use the newer version, you only need to write the body of the `Main` method. The compiler generates a `Program` class with an entry point method and places all your top level statements in that method. The name of the generated method isn't `Main`, it's an implementation detail that your code can't reference directly. You don't need to include the other program elements, the compiler generates them for you. You can learn more about the code the compiler generates when you use top level statements in the article on [top level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) in the C# Guide's fundamentals section.
37+
These two forms represent the same program. Both are valid in C#. When you use the newer version, you only need to write the body of the `Main` method. The compiler generates a `Program` class with an entry point method and places all your top level statements in that method. The name of the generated method isn't `Main`, it's an implementation detail that your code can't reference directly. You don't need to include the other program elements, the compiler generates them for you. You can learn more about the code the compiler generates when you use top level statements in the article on [top level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) in the C# Guide's fundamentals section.
3838

3939
You have two options to work with tutorials that aren't updated to use .NET 6+ templates:
4040

docs/core/tutorials/with-visual-studio-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create a .NET console application using Visual Studio Code
33
description: Learn how to create a .NET console application using Visual Studio Code.
4-
ms.date: 09/12/2024
4+
ms.date: 11/22/2024
55
zone_pivot_groups: dotnet-version
66
---
77
# Tutorial: Create a .NET console application using Visual Studio Code
@@ -168,7 +168,7 @@ Create a .NET console app project named "HelloWorld".
168168
169169
The code defines a class, `Program`, with a single method, `Main`, that takes a <xref:System.String> array as an argument. `Main` is the application entry point, the method that's called automatically by the runtime when it launches the application. Any command-line arguments supplied when the application is launched are available in the *args* array.
170170

171-
In the latest version of C#, a new feature named [top-level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) lets you omit the `Program` class and the `Main` method. Most existing C# programs don't use top-level statements, so this tutorial doesn't use this new feature. But it's available in C# 10, and whether you use it in your programs is a matter of style preference.
171+
In the latest version of C#, a new feature named [top-level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) lets you omit the `Program` class and the `Main` method. Most existing C# programs don't use top-level statements, so this tutorial doesn't use this new feature. But it's the current default for new C# programs. Whether you use it in your programs is a matter of style preference.
172172

173173
## Run the app
174174

docs/core/tutorials/with-visual-studio.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create a .NET console application using Visual Studio
33
description: Learn how to create a .NET console application with C# or Visual Basic using Visual Studio.
4-
ms.date: 03/21/2024
4+
ms.date: 11/22/2024
55
zone_pivot_groups: dotnet-version
66
dev_langs:
77
- "csharp"
@@ -186,7 +186,7 @@ Create a .NET console app project named "HelloWorld".
186186

187187
The code defines a class, `Program`, with a single method, `Main`, that takes a <xref:System.String> array as an argument. `Main` is the application entry point, the method that's called automatically by the runtime when it launches the application. Any command-line arguments supplied when the application is launched are available in the *args* array.
188188

189-
In the latest version of C#, a new feature named [top-level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) lets you omit the `Program` class and the `Main` method. Most existing C# programs don't use top-level statements, so this tutorial doesn't use this new feature. But it's available in C# 10, and whether you use it in your programs is a matter of style preference.
189+
In the latest version of C#, a new feature named [top-level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) lets you omit the `Program` class and the `Main` method. Most existing C# programs don't use top-level statements, so this tutorial doesn't use this new feature. But it's the current default for new C# programs. Whether you use it in your programs is a matter of style preference.
190190

191191
## Run the app
192192

@@ -306,7 +306,7 @@ Create a .NET console app project named "HelloWorld".
306306

307307
The code defines a class, `Program`, with a single method, `Main`, that takes a <xref:System.String> array as an argument. `Main` is the application entry point, the method that's called automatically by the runtime when it launches the application. Any command-line arguments supplied when the application is launched are available in the *args* array.
308308

309-
In the latest version of C#, a new feature named [top-level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) lets you omit the `Program` class and the `Main` method. Most existing C# programs don't use top-level statements, so this tutorial doesn't use this new feature. But it's available in C# 10, and whether you use it in your programs is a matter of style preference.
309+
In the latest version of C#, a new feature named [top-level statements](../../csharp/fundamentals/program-structure/top-level-statements.md) lets you omit the `Program` class and the `Main` method. Most existing C# programs don't use top-level statements, so this tutorial doesn't use this new feature. But it's the current default for new C# programs. Whether you use it in your programs is a matter of style preference.
310310

311311
## Run the app
312312

docs/csharp/asynchronous-programming/async-return-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Async return types
33
description: Learn about the return types that async methods can have in C# with code examples for each type.
4-
ms.date: 02/08/2023
4+
ms.date: 11/22/2024
55
---
66

77
# Async return types (C#)
@@ -81,7 +81,7 @@ This feature is the complement to [awaitable expressions](~/_csharpstandard/stan
8181

8282
Writing a generalized async return type is an advanced scenario, and is targeted for use in specialized environments. Consider using the `Task`, `Task<T>`, and `ValueTask<T>` types instead, which cover most scenarios for asynchronous code.
8383

84-
In C# 10 and later, you can apply the `AsyncMethodBuilder` attribute to an async method (instead of the async return type declaration) to override the builder for that type. Typically you'd apply this attribute to use a different builder provided in the .NET runtime.
84+
You can apply the `AsyncMethodBuilder` attribute to an async method (instead of the async return type declaration) to override the builder for that type. Typically you'd apply this attribute to use a different builder provided in the .NET runtime.
8585

8686
## Async streams with IAsyncEnumerable\<T\>
8787

docs/csharp/fundamentals/functional/deconstruct.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Deconstructing tuples and other types
33
description: Learn how to deconstruct tuples and other types.
4-
ms.date: 11/10/2021
4+
ms.date: 11/22/2024
55
---
66
# Deconstructing tuples and other types
77

@@ -41,7 +41,7 @@ There are three ways to deconstruct a tuple:
4141

4242
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-tuple5.cs" ID="Snippet1":::
4343

44-
- Beginning in C# 10, you can mix variable declaration and assignment in a deconstruction.
44+
- You can mix variable declaration and assignment in a deconstruction.
4545

4646
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-tuple6.cs" ID="Snippet1":::
4747

docs/csharp/fundamentals/program-structure/top-level-statements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Top-level statements - programs without Main methods"
33
description: Learn about top-level statements. You can create programs without the ceremony of a Program class and a Main method.
4-
ms.date: 08/19/2021
4+
ms.date: 11/22/2024
55
helpviewer_keywords:
66
- "C# language, top-level statements"
77
- "C# language, Main method"
@@ -14,7 +14,7 @@ Top-level statements allows you to write executable code directly at the root of
1414
This means you can create programs without the ceremony of a `Program` class and a `Main` method.
1515
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.
1616

17-
Here's a *Program.cs* file that is a complete C# program in C# 10:
17+
Here's a *Program.cs* file that is a complete C# program:
1818

1919
```csharp
2020
Console.WriteLine("Hello World!");

docs/csharp/fundamentals/types/namespaces.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Organizing types in namespaces"
33
description: Learn how namespaces help you organize related types.
4-
ms.date: 05/14/2021
4+
ms.date: 11/24/2024
55
helpviewer_keywords:
66
- "C# language, namespaces"
77
- "namespaces [C#]"
@@ -28,7 +28,7 @@ Second, declaring your own namespaces can help you control the scope of class an
2828

2929
The name of the namespace must be a valid C# [identifier name](../coding-style/identifier-names.md).
3030

31-
Beginning with C# 10, you can declare a namespace for all types defined in that file, as shown in the following example:
31+
You can declare a namespace for all types defined in that file, as shown in the following example:
3232

3333
:::code language="csharp" source="snippets/namespaces/filescopednamespace.cs":::
3434

docs/csharp/how-to/concatenate-multiple-strings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "How to concatenate multiple strings"
33
description: There are multiple ways to concatenate strings in C#. Learn the options and the reasons behind different choices.
4-
ms.date: 03/15/2024
4+
ms.date: 11/22/2024
55
helpviewer_keywords:
66
- "joining strings [C#]"
77
- "concatenating strings [C#]"
@@ -35,7 +35,7 @@ In some expressions, it's easier to concatenate strings using string interpolati
3535
> [!NOTE]
3636
> In string concatenation operations, the C# compiler treats a null string the same as an empty string.
3737
38-
Beginning with C# 10, you can use string interpolation to initialize a constant string when all the expressions used for placeholders are also constant strings.
38+
You can use string interpolation to initialize a constant string when all the expressions used for placeholders are also constant strings.
3939

4040
## `String.Format`
4141

docs/csharp/language-reference/attributes/general.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Attributes interpreted by the compiler: Miscellaneous"
3-
ms.date: 07/26/2024
3+
ms.date: 11/22/2024
44
description: "Learn about attributes that affect code generated by the compiler: the Conditional, Obsolete, AttributeUsage, ModuleInitializer, and SkipLocalsInit attributes."
55
---
66
# Miscellaneous attributes interpreted by the C# compiler
@@ -54,9 +54,7 @@ In the following example, the `Obsolete` attribute is applied to class `A` and t
5454

5555
:::code language="csharp" source="snippets/ObsoleteExample.cs" ID="Snippet1" interactive="try-dotnet" :::
5656

57-
The string provided as the first argument to the attribute constructor is displayed as part of the warning or error. Two warnings for class `A` are generated: one for the declaration of the class reference, and one for the class constructor. The `Obsolete` attribute can be used without arguments, but including an explanation what to use instead is recommended.
58-
59-
In C# 10, you can use constant string interpolation and the `nameof` operator to ensure the names match:
57+
The string provided as the first argument to the attribute constructor is displayed as part of the warning or error. Two warnings for class `A` are generated: one for the declaration of the class reference, and one for the class constructor. The `Obsolete` attribute can be used without arguments, but including an explanation what to use instead is recommended. You can use constant string interpolation and the `nameof` operator to ensure the names match:
6058

6159
:::code language="csharp" source="snippets/ObsoleteExample.cs" id="Snippet2" :::
6260

@@ -165,13 +163,13 @@ You can learn about async method builders by reading about the following builder
165163
- <xref:System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder?displayProperty=fullName>
166164
- <xref:System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder%601?displayProperty=fullName>
167165

168-
In C# 10 and later, the `AsyncMethodBuilder` attribute can be applied to an async method to override the builder for that type.
166+
The `AsyncMethodBuilder` attribute can be applied to an async method to override the builder for that type.
169167

170168
## `InterpolatedStringHandler` and `InterpolatedStringHandlerArguments` attributes
171169

172-
Starting with C# 10, you use these attributes to specify that a type is an *interpolated string handler*. The .NET 6 library already includes <xref:System.Runtime.CompilerServices.DefaultInterpolatedStringHandler?displayProperty=nameWithType> for scenarios where you use an interpolated string as the argument for a `string` parameter. You might have other instances where you want to control how interpolated strings are processed. You apply the <xref:System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute?displayProperty=nameWithType> to the type that implements your handler. You apply the <xref:System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute?displayProperty=nameWithType> to parameters of that type's constructor.
170+
You use these attributes to specify that a type is an *interpolated string handler*. The .NET 6 library already includes <xref:System.Runtime.CompilerServices.DefaultInterpolatedStringHandler?displayProperty=nameWithType> for scenarios where you use an interpolated string as the argument for a `string` parameter. You might have other instances where you want to control how interpolated strings are processed. You apply the <xref:System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute?displayProperty=nameWithType> to the type that implements your handler. You apply the <xref:System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute?displayProperty=nameWithType> to parameters of that type's constructor.
173171

174-
You can learn more about building an interpolated string handler in the C# 10 feature specification for [interpolated string improvements](~/_csharplang/proposals/csharp-10.0/improved-interpolated-strings.md).
172+
You can learn more about building an interpolated string handler in the feature specification for [interpolated string improvements](~/_csharplang/proposals/csharp-10.0/improved-interpolated-strings.md).
175173

176174
## `ModuleInitializer` attribute
177175

docs/csharp/language-reference/builtin-types/default-values.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Default values of built in types"
33
description: "Learn the default values of C# types such as bool, char, int, float, double and more."
4-
ms.date: 09/28/2021
4+
ms.date: 11/22/2024
55
helpviewer_keywords:
66
- "default [C#]"
77
- "parameterless constructor [C#]"
@@ -47,15 +47,15 @@ Console.WriteLine(n); // output: (0, 0)
4747
At run time, if the <xref:System.Type?displayProperty=nameWithType> instance represents a value type, you can use the <xref:System.Activator.CreateInstance(System.Type)?displayProperty=nameWithType> method to invoke the parameterless constructor to obtain the default value of the type.
4848

4949
> [!NOTE]
50-
> In C# 10 and later, a [structure type](struct.md) (which is a value type) may have an [explicit parameterless constructor](struct.md#struct-initialization-and-default-values) that may produce a non-default value of the type. Thus, we recommend using the `default` operator or the `default` literal to produce the default value of a type.
50+
> A [structure type](struct.md) (which is a value type) may have an [explicit parameterless constructor](struct.md#struct-initialization-and-default-values) that may produce a non-default value of the type. Thus, we recommend using the `default` operator or the `default` literal to produce the default value of a type.
5151
5252
## C# language specification
5353

5454
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
5555

5656
- [Default values](~/_csharpstandard/standard/variables.md#93-default-values)
5757
- [Default constructors](~/_csharpstandard/standard/types.md#833-default-constructors)
58-
- [C# 10 - Parameterless struct constructors](~/_csharplang/proposals/csharp-10.0/parameterless-struct-constructors.md)
58+
- [Parameterless struct constructors](~/_csharplang/proposals/csharp-10.0/parameterless-struct-constructors.md)
5959
- [C# 11 - Auto default structs](~/_csharplang/proposals/csharp-11.0/auto-default-structs.md)
6060

6161
## See also

0 commit comments

Comments
 (0)