Skip to content

Commit 33534f1

Browse files
CopilotBillWagnerCopilot
authored
Update What's New documentation for .NET 10 RC 2 (#49283)
* Initial plan * Update .NET 10 What's New articles for RC 2 Co-authored-by: BillWagner <[email protected]> * Apply suggestions from code review Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: BillWagner <[email protected]> Co-authored-by: Bill Wagner <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 2e6c0d8 commit 33534f1

File tree

4 files changed

+57
-8
lines changed

4 files changed

+57
-8
lines changed

docs/core/whats-new/dotnet-10/libraries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: What's new in .NET libraries for .NET 10
33
description: Learn about the updates to the .NET libraries for .NET 10.
44
titleSuffix: ""
5-
ms.date: 09/09/2025
5+
ms.date: 10/15/2025
66
ai-usage: ai-assisted
77
ms.update-cycle: 3650-days
88
---
99

1010
# What's new in .NET libraries for .NET 10
1111

12-
This article describes new features in the .NET libraries for .NET 10. It's been updated for RC 1.
12+
This article describes new features in the .NET libraries for .NET 10. It's been updated for RC 2.
1313

1414
## Cryptography
1515

docs/core/whats-new/dotnet-10/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: What's new in .NET 10
33
description: Learn about the new features introduced in .NET 10 for the runtime, libraries, and SDK. Also find links to what's new in other areas, such as ASP.NET Core.
44
titleSuffix: ""
5-
ms.date: 09/09/2025
5+
ms.date: 10/15/2025
66
ai-usage: ai-assisted
77
ms.update-cycle: 3650-days
88
---
99

1010
# What's new in .NET 10
1111

12-
Learn about the new features in .NET 10 and find links to further documentation. This page has been updated for RC 1.
12+
Learn about the new features in .NET 10 and find links to further documentation. This page has been updated for RC 2.
1313

1414
.NET 10, the successor to [.NET 9](../dotnet-9/overview.md), is [supported for three years](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) as a long-term support (LTS) release. You can [download .NET 10 here](https://get.dot.net/10).
1515

docs/core/whats-new/dotnet-10/runtime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: What's new in .NET 10 runtime
33
description: Learn about the new features introduced in the .NET 10 runtime.
44
titleSuffix: ""
5-
ms.date: 09/09/2025
5+
ms.date: 10/15/2025
66
ai-usage: ai-assisted
77
ms.update-cycle: 3650-days
88
---
99
# What's new in the .NET 10 runtime
1010

11-
This article describes new features and performance improvements in the .NET runtime for .NET 10. It's been updated for RC 1.
11+
This article describes new features and performance improvements in the .NET runtime for .NET 10. It's been updated for RC 2.
1212

1313
## JIT compiler improvements
1414

docs/core/whats-new/dotnet-10/sdk.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: What's new in the SDK and tooling for .NET 10
33
description: Learn about the new .NET SDK features introduced in .NET 10.
44
titleSuffix: ""
5-
ms.date: 09/09/2025
5+
ms.date: 10/15/2025
66
ai-usage: ai-assisted
77
ms.update-cycle: 3650-days
88
---
99

1010
# What's new in the SDK and tooling for .NET 10
1111

12-
This article describes new features and enhancements in the .NET SDK for .NET 10. It's been updated for RC 1.
12+
This article describes new features and enhancements in the .NET SDK for .NET 10. It's been updated for RC 2.
1313

1414
## .NET tools enhancements
1515

@@ -111,6 +111,55 @@ The output provides a structured, machine-readable description of the command's
111111
}
112112
```
113113
114+
## Use .NET MSBuild tasks with .NET Framework MSBuild
115+
116+
MSBuild is the underlying build system for .NET, driving both build of projects (as seen in commands like `dotnet build` and `dotnet pack`), and acting as a general provider of information about projects (as seen in commands like `dotnet list package`, and implicitly used by commands like `dotnet run` to discover how a project wants to be executed).
117+
118+
When running `dotnet` CLI commands, the version of MSBuild that is used is the one that is shipped with the .NET SDK. However, when using Visual Studio or invoking MSBuild directly, the version of MSBuild that is used is the one that is installed with Visual Studio. This environment difference has a few important consequences. The most important is that MSBuild running in Visual Studio (or through `msbuild.exe`) is a .NET Framework application, while MSBuild running in the `dotnet` CLI is a .NET application. This means that any MSBuild tasks that are written to run on .NET can't be used when building in Visual Studio or when using `msbuild.exe`.
119+
120+
Starting with .NET 10, `msbuild.exe` and Visual Studio 2026 can run MSBuild tasks that are built for .NET. This means that you can now use the same MSBuild tasks when building in Visual Studio or using `msbuild.exe` as you do when building with the `dotnet` CLI. For most .NET users, this won't change anything. But for authors of custom MSBuild tasks, this means that you can now write your tasks to target .NET and have them work everywhere. The goal with this change is to make it easier to write and share MSBuild tasks, and to allow task authors to take advantage of the latest features in .NET. In addition, this change reduces the difficulties around multi-targeting tasks to support both .NET Framework and .NET, and dealing with versions of .NET Framework dependencies that are implicitly available in the MSBuild .NET Framework execution space.
121+
122+
### Configure .NET tasks
123+
124+
For task authors, it's easy to opt into this new behavior. Just change your `UsingTask` declaration to tell MSBuild about your task.
125+
126+
```xml
127+
<UsingTask TaskName="MyTask"
128+
AssemblyFile="path\to\MyTask.dll"
129+
Runtime="NET"
130+
TaskFactory="TaskHostFactory"
131+
/>
132+
```
133+
134+
The `Runtime="NET"` and `TaskFactory="TaskHostFactory"` attributes tell the MSBuild engine how to run the Task:
135+
136+
- `Runtime="NET"` tells MSBuild that the Task is built for .NET (as opposed to .NET Framework).
137+
- `TaskFactory="TaskHostFactory"` tells MSBuild to use the `TaskHostFactory` to run the Task, which is an existing capability of MSBuild that allows tasks to be run out-of-process.
138+
139+
### Caveats and performance tuning
140+
141+
The preceding example is the simplest way to get started using .NET tasks in MSBuild, but it has some limitations. Because the `TaskHostFactory` always runs tasks out-of-process, the new .NET task always runs in a separate process from MSBuild. This means that there is some minor overhead to running the task because the MSBuild engine and the task communicate over inter-process communication (IPC) instead of in-process communication. For most tasks, this overhead is negligible, but for tasks that are run many times in a build, or that do a lot of logging, this overhead might be more significant.
142+
143+
With just a bit more work, you can configure the task to still run in-process when running via `dotnet`:
144+
145+
```xml
146+
<UsingTask TaskName="MyTask"
147+
AssemblyFile="path\to\MyTask.dll"
148+
Runtime="NET"
149+
TaskFactory="TaskHostFactory"
150+
Condition="$(MSBuildRuntimeType) == 'Full'"
151+
/>
152+
<UsingTask TaskName="MyTask"
153+
AssemblyFile="path\to\MyTask.dll"
154+
Runtime="NET"
155+
Condition="$(MSBuildRuntimeType) == 'Core'"
156+
/>
157+
```
158+
159+
Thanks to the `Condition` feature of MSBuild, you can load a Task differently depending on whether MSBuild is running in .NET Framework (Visual Studio or `msbuild.exe`) or .NET (the `dotnet` CLI). In this example, the Task runs out-of-process when running in Visual Studio or `msbuild.exe`, but runs in-process when running in the `dotnet` CLI. This gives the best performance when running in the `dotnet` CLI, while still allowing the Task to be used in Visual Studio and `msbuild.exe`.
160+
161+
There are also small technical limitations to be aware of when using .NET Tasks in MSBuild—the most notable of which is that the `Host Object` feature of MSBuild Tasks isn't yet supported for .NET Tasks running out-of-process. This means that if your Task relies on a Host Object, it won't work when running in Visual Studio or `msbuild.exe`. Additional support for Host Objects is planned in future releases.
162+
114163
## File-based apps enhancements
115164
116165
.NET 10 brings significant updates to the file-based apps experience, including publish support and native AOT capabilities. For an introduction to file-based apps, see [File-based apps](../../../csharp/tour-of-csharp/overview.md#file-based-apps) and [Building and running C# programs](../../../csharp/fundamentals/program-structure/index.md#building-and-running-c-programs).

0 commit comments

Comments
 (0)