Enable RuntimeAsync as .NET 11 preview feature#6488
Enable RuntimeAsync as .NET 11 preview feature#6488manandre wants to merge 13 commits intonpgsql:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the repo to build and test against the .NET 11 preview SDK and enables the runtime-async preview feature when targeting net11.0, to surface runtime-async related issues earlier in the release cycle.
Changes:
- Multi-target core library, plugins, and tests for
net10.0;net11.0. - Opt in to .NET 11 preview features and enable
runtime-async=onfornet11.0builds. - Update CI/dev tooling to use a .NET 11 preview SDK and run most CI test legs on
net11.0.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Directory.Build.props | Multi-target tests for net10.0 and net11.0. |
| src/Npgsql/Npgsql.csproj | Multi-target Npgsql for net10.0;net11.0. |
| src/Npgsql.OpenTelemetry/Npgsql.OpenTelemetry.csproj | Multi-target OpenTelemetry plugin for net10.0;net11.0. |
| src/Npgsql.NodaTime/Npgsql.NodaTime.csproj | Multi-target NodaTime plugin for net10.0;net11.0. |
| src/Npgsql.NetTopologySuite/Npgsql.NetTopologySuite.csproj | Multi-target NTS plugin for net10.0;net11.0. |
| src/Npgsql.Json.NET/Npgsql.Json.NET.csproj | Multi-target Json.NET plugin for net10.0;net11.0. |
| src/Npgsql.GeoJSON/Npgsql.GeoJSON.csproj | Multi-target GeoJSON plugin for net10.0;net11.0. |
| src/Npgsql.DependencyInjection/Npgsql.DependencyInjection.csproj | Multi-target DI plugin for net10.0;net11.0. |
| global.json | Move repo SDK to .NET 11 preview and allow prerelease SDK usage. |
| Directory.Packages.props | Expand version property condition to include net11.0. |
| Directory.Build.props | Enable preview features and runtime-async=on for net11.0. |
| .github/workflows/native-aot.yml | Pin/setup .NET 11 preview SDK and run NativeAOT checks on net11.0. |
| .github/workflows/build.yml | Pin/setup .NET 11 preview SDK and run most test matrix legs on net11.0. |
| .devcontainer/devcontainer.json | Update devcontainer to use .NET 11 preview SDK and adjust runtime installs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@manandre thanks, it's a good idea; but is it a bit premature to do this, given that even the runtime libraries themselves (and their tests) aren't being built with runtime-async? Also, I'm unclear on whether targeting the net11.0 TFM is necessary here - do you have any resources/info you can point to on this? We may end up multi-targeting in any case if we need some new API introduced in net11.0; it would just be better to not do this unless there's such a case. In any case, we can of course use the latest dotnet preview SDK - that's always a good idea. |
|
Seems like we're already running into a NativeAOT compiler bug in this area. I've locally also run into debugger issues on the runtime shipped with SDK 10.0.200 (10.0.4) which seems to have already opted into some runtime async. |
Yes, it is now officially documented in dotnet/runtime#109632
|
|
Going to convert this to a draft until the next preview is released. |
This reverts commit 8236a51.
|
I have moved to .NET 11 Preview 3 (released yesterday) which now supports NativeAOT, but the same NativeAOT issue is still present :/ |
|
Yes I think they would absolutely welcome it sooner rather than later. I did a very quick search on dotnet/runtime and can't find any issues related to this either. Thanks for making the repro. |
See dotnet/runtime#109632
The target is to detect potential issues as soon as possible and not wait for .NET release candidates, when it is generally difficult to get fixes in time.