Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "What's new in C# 10" #43694

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .openpublishing.redirection.csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -4174,7 +4174,7 @@
},
{
"source_path_from_root": "/docs/csharp/tutorials/exploration/patterns-objects.md",
"redirect_url": "/dotnet/csharp/whats-new/tutorials/patterns-objects"
"redirect_url": "/dotnet/csharp/tutorials/patterns-objects"
},
{
"source_path_from_root": "/docs/csharp/tutorials/exploration/records.md",
Expand Down Expand Up @@ -4297,13 +4297,17 @@
"source_path_from_root": "/docs/csharp/whats-new/csharp-7.md",
"redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-70"
},
{
"source_path_from_root": "/docs/csharp/whats-new/csharp-8.md",
"redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-80"
},
{
"source_path_from_root": "/docs/csharp/whats-new/csharp-9.md",
"redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-9"
},
{
"source_path_from_root": "/docs/csharp/whats-new/csharp-8.md",
"redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-80"
"source_path_from_root": "/docs/csharp/whats-new/csharp-10.md",
"redirect_url": "/dotnet/csharp/whats-new/csharp-version-history#c-version-10"
},
{
"source_path_from_root": "/docs/csharp/whats-new/index.md",
Expand Down Expand Up @@ -4334,6 +4338,14 @@
"source_path_from_root": "/docs/csharp/whats-new/tutorials/ranges-indexes.md",
"redirect_url": "/dotnet/csharp/tutorials/ranges-indexes"
},
{
"source_path_from_root": "/docs/csharp/whats-new/tutorials/interpolated-string-handler.md",
"redirect_url": "/dotnet/csharp/advanced-topics/performance/interpolated-string-handler"
},
{
"source_path_from_root": "/docs/csharp/whats-new/tutorials/patterns-objects.md",
"redirect_url": "/dotnet/csharp/tutorials/patterns-objects"
},
{
"source_path_from_root": "/docs/csharp/write-safe-efficient-code.md",
"redirect_url": "/dotnet/csharp/advanced-topics/performance"
Expand Down
4 changes: 2 additions & 2 deletions docs/core/tutorials/top-level-templates.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "C# console app template changes in .NET 6+"
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.
ms.date: 03/15/2024
ms.date: 11/22/2024
---
# C# console app template generates top-level statements

Expand Down Expand Up @@ -34,7 +34,7 @@ namespace MyApp

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

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.
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.

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

Expand Down
4 changes: 2 additions & 2 deletions docs/core/tutorials/with-visual-studio-code.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Create a .NET console application using Visual Studio Code
description: Learn how to create a .NET console application using Visual Studio Code.
ms.date: 09/12/2024
ms.date: 11/22/2024
zone_pivot_groups: dotnet-version
---
# Tutorial: Create a .NET console application using Visual Studio Code
Expand Down Expand Up @@ -168,7 +168,7 @@ Create a .NET console app project named "HelloWorld".

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.

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.
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.

## Run the app

Expand Down
6 changes: 3 additions & 3 deletions docs/core/tutorials/with-visual-studio.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Create a .NET console application using Visual Studio
description: Learn how to create a .NET console application with C# or Visual Basic using Visual Studio.
ms.date: 03/21/2024
ms.date: 11/22/2024
zone_pivot_groups: dotnet-version
dev_langs:
- "csharp"
Expand Down Expand Up @@ -186,7 +186,7 @@ Create a .NET console app project named "HelloWorld".

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.

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.
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.

## Run the app

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

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.

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.
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.

## Run the app

Expand Down
5 changes: 2 additions & 3 deletions docs/core/whats-new/dotnet-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ author: gewarren

.NET 6 delivers the final parts of the .NET unification plan that started with [.NET 5](dotnet-5.md). .NET 6 unifies the SDK, base libraries, and runtime across mobile, desktop, IoT, and cloud apps. In addition to this unification, the .NET 6 ecosystem offers:

- **Simplified development**: Getting started is easy. New language features in [C# 10](../../csharp/whats-new/csharp-10.md) reduce the amount of code you need to write. And investments in the web stack and minimal APIs make it easy to quickly write smaller, faster microservices.
- **Simplified development**: Getting started is easy. New language features in [C# 10](../../csharp/whats-new/csharp-version-history.md#c-version-10) reduce the amount of code you need to write. And investments in the web stack and minimal APIs make it easy to quickly write smaller, faster microservices.

- **Better performance**: .NET 6 is the fastest full stack web framework, which lowers compute costs if you're running in the cloud.

Expand Down Expand Up @@ -54,7 +54,7 @@ The .NET 6 release includes support for macOS Arm64 (or "Apple Silicon") and Win

## C# 10 and templates

C# 10 includes innovations such as `global using` directives, file-scoped namespace declarations, and record structs. For more information, see [What's new in C# 10](../../csharp/whats-new/csharp-10.md).
C# 10 includes innovations such as `global using` directives, file-scoped namespace declarations, and record structs. For more information, see [C# Language version history](../../csharp/whats-new/csharp-version-history.md#c-version-10).

In concert with that work, the .NET SDK project templates for C# have been modernized to use some of the new language features:

Expand Down Expand Up @@ -273,7 +273,6 @@ The new <xref:System.Collections.Generic.PriorityQueue%602> class represents a c

## See also

- [What's new in C# 10](../../csharp/whats-new/csharp-10.md)
- [What's new in F# 6](../../fsharp/whats-new/fsharp-6.md)
- [What's new in EF Core 6](/ef/core/what-is-new/ef-core-6.0/whatsnew)
- [What's new in ASP.NET Core 6](/aspnet/core/release-notes/aspnetcore-6.0)
Expand Down
Loading