Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Closes #

Adds net10.0 as the default target framework moniker (TFM) and enables multi-targeting for .NET 8.0, 9.0, and 10.0 (preview) across all source projects.

Changes Made

Build Configuration

  • Directory.Build.props:
    • Changed DefaultTargetFramework from net8.0 to net10.0
    • Set AllTargetFrameworks to net10.0;net8.0;net9.0
  • Directory.Packages.props: Added .NET 10 Overrides section using 9.0.10 package versions for compatibility during preview phase
  • global.json: Enabled prerelease SDK support (allowPrerelease: true)
  • Project workarounds: Extended existing .NET 9.0 conditions to include 10.0 in SqlDatabaseProjects and SqlServer.Extensions projects (Aspire issue #7779 workaround)

GitHub Actions Workflows

Updated all workflows and composite actions to install and support .NET 10:

  • dotnet-main.yml and dotnet-release.yml: Changed DEFAULT_DOTNET_VERSION to 10.0.x
  • codeql.yml, package.yml, and generate-api-diffs.yml: Added 10.0.x to dotnet-version lists
  • generate-api-diffs.yml: Updated build target from net8.0 to net10.0
  • setup-runtimes-caching/action.yml: Added 10.0.x to dotnet-version list in the composite action

Development Environment

  • devcontainer.json: Updated to install .NET 10 preview as the primary SDK version with .NET 8.0 and 9.0 as additional versions

Impact

  • Default TFM: .NET 10 is now the primary framework (affects examples and tests)
  • Source Projects: All src/ projects multi-target to net10.0, net8.0, and net9.0
  • CI/CD: All GitHub Actions workflows and composite actions now install and build with .NET 10 preview
  • Development Environment: Devcontainer now installs .NET 10 preview as the primary SDK
  • NuGet Packages: Will include binaries for all three target frameworks

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

This change enables .NET 10 preview as the default framework. The repository now requires .NET 10 SDK (preview) for building. All CI/CD workflows, composite actions, and the development environment (devcontainer) have been updated to install .NET 10 preview alongside .NET 8 and 9 for multi-targeting support.

Original prompt

Add .NET 10 (currently preview) as a TFM that is used in the multi-targetting builds


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copilot AI changed the title [WIP] Add .NET 10 as a TFM for multi-targeting builds Add .NET 10 (preview) as a TFM for multi-targeting builds Nov 6, 2025
Copilot AI requested a review from aaronpowell November 6, 2025 05:19
Copilot finished work on behalf of aaronpowell November 6, 2025 05:19
@aaronpowell
Copy link
Member

@copilot can you make the default TFM .NET 10 and also ensure any GitHub Actions that install .NET are installing .NET 10 as well

…ET 10

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 6, 2025

@copilot can you make the default TFM .NET 10 and also ensure any GitHub Actions that install .NET are installing .NET 10 as well

Done! I've made the following changes in commit 303a76f:

  1. Changed default TFM to .NET 10:

    • DefaultTargetFramework is now net10.0
    • AllTargetFrameworks reordered to net10.0;net8.0;net9.0
    • Enabled prerelease SDKs in global.json
  2. Updated GitHub Actions to install .NET 10:

    • dotnet-main.yml and dotnet-release.yml: Changed DEFAULT_DOTNET_VERSION to 10.0.x
    • codeql.yml, package.yml, and generate-api-diffs.yml: Added 10.0.x to the dotnet-version list
    • generate-api-diffs.yml: Updated build target from net8.0 to net10.0

All examples, tests, and the default build now use .NET 10 as the primary framework.

Copilot AI changed the title Add .NET 10 (preview) as a TFM for multi-targeting builds Add .NET 10 (preview) as the default TFM and enable multi-targeting builds Nov 6, 2025
Copilot finished work on behalf of aaronpowell November 6, 2025 05:29
@aaronpowell
Copy link
Member

@copilot can you also ensure the devcontainer will install .NET 10 as preview

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 6, 2025

@copilot can you also ensure the devcontainer will install .NET 10 as preview

Done! Updated the devcontainer configuration in commit c6b19fc:

  • Changed primary .NET version from 8.0 to 10.0
  • Updated additionalVersions to include 8.0,9.0
  • Added installUsingApt: false to ensure preview versions are installed from Microsoft's feeds

The devcontainer will now install .NET 10 preview as the primary SDK with .NET 8 and 9 as additional versions.

Copilot finished work on behalf of aaronpowell November 6, 2025 05:44
@aaronpowell
Copy link
Member

@copilot missed one place to install .NET 10 - the action.yml in .github/actions/setup-runtimes-caching

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 6, 2025

@copilot missed one place to install .NET 10 - the action.yml in .github/actions/setup-runtimes-caching

Fixed in commit 1e4e20d. Added 10.0.x to the dotnet-version list in .github/actions/setup-runtimes-caching/action.yml.

Copilot finished work on behalf of aaronpowell November 6, 2025 05:59
@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

@aaronpowell Related to this? dotnet/efcore#37114

@aaronpowell
Copy link
Member

@aaronpowell Related to this? dotnet/efcore#37114

I don't think so. You'll notice that 1911944 sees a green build now, and the solution is that you have to very forcibly remove some assemblies from the project that is consuming the integration.

It's fine in our repo, since we control it, but I'm hoping that we can inject a props file to force it too

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

@dzsquared #949 (comment) - possible to avoid this dependency for a single execption type?

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

@aaronpowell Is there a CI build of this I can test in relation to #970 ?

@aaronpowell
Copy link
Member

@dzsquared #949 (comment) - possible to avoid this dependency for a single execption type?

Nothing we can about the usage in the DacFx assembly, we can only "deal with" the output that it's generating. Basically what we have to do is remove the Microsoft.Build.dll, Microsoft.Build.Framework.dll and Microsoft.NET.StringTools.dll files from the bin of the app host (or tests). In our repo, I hacked this by adding them to the csproj of the tests project, but that's not super obvious for a consumer.

To solve the install-from-nuget scenario, I'm trying to ship a .props file that will get added and in turn will do the removal, which should be transparent to the consumer, but on the latest CI build it's not including the .props file, despite everything I'm reading saying that it's done correctly 😭.

@aaronpowell Is there a CI build of this I can test in relation to #970 ?

You can test using the ADO feed, or download the artifacts from the last CI build (I've just pulled the artifacts locally) but you'll still have to manually do what the .props file is doing.

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

@aaronpowell "Nothing we can about the usage in the DacFx assembly, we can only "deal with" the output that it's generating. " - yes, this was a question to the owner of DacFX!

I will try to manually remove the three files

@aaronpowell
Copy link
Member

@aaronpowell "Nothing we can about the usage in the DacFx assembly, we can only "deal with" the output that it's generating. " - yes, this was a question to the owner of DacFX!

I will try to manually remove the three files

Ah right - unfortunately it's not OSS so that's adding a spanner into the works of digging through what's going on too

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

Maybe consider .NET 10 one-shot execution of microsoft.sqlpackage instead, that will remove any reference to DacFX?

@aaronpowell
Copy link
Member

I'm keen to try anything at this point, as I'm getting lost in the depths of msbuild and it's scary down here 🤣

@aaronpowell
Copy link
Member

@ErikEJ when 90fb953 builds, and assuming it's green (it's green locally for me), grab those artifacts and do your test.

I've got it going nuclear and deleting the files with a msbuild task after the build is completed 🤣 (worked locally!)

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

@aaronpowell OK, so the Targets file in the hosting package will remove the files?

@aaronpowell
Copy link
Member

aaronpowell commented Nov 14, 2025

@aaronpowell OK, so the Targets file in the hosting package will remove the files?

Yep.

It feels super dirty 🤣

@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.GoFeatureFlag 100% 97% 74
CommunityToolkit.Aspire.Hosting.ActiveMQ 78% 40% 108
CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.Adminer 73% 50% 20
CommunityToolkit.Aspire.Hosting.Azure.Dapr 29% 7% 124
CommunityToolkit.Aspire.Hosting.Azure.Dapr.Redis 61% 34% 76
CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 100% 100% 22
CommunityToolkit.Aspire.Hosting.Bun 96% 83% 28
CommunityToolkit.Aspire.Hosting.Dapr 60% 37% 840
CommunityToolkit.Aspire.Hosting.DbGate 94% 50% 18
CommunityToolkit.Aspire.Hosting.Deno 98% 85% 44
CommunityToolkit.Aspire.Hosting.Flagd 79% 100% 32
CommunityToolkit.Aspire.Hosting.GoFeatureFlag 87% 73% 36
CommunityToolkit.Aspire.Hosting.Golang 87% 70% 28
CommunityToolkit.Aspire.Hosting.Java 70% 75% 130
CommunityToolkit.Aspire.Hosting.JavaScript.Extensions 97% 85% 200
CommunityToolkit.Aspire.Hosting.k6 58% 12% 20
CommunityToolkit.Aspire.Hosting.Keycloak.Extensions 100% 100% 22
CommunityToolkit.Aspire.Hosting.KurrentDB 71% 75% 34
CommunityToolkit.Aspire.Hosting.LavinMQ 74% 50% 26
CommunityToolkit.Aspire.Hosting.LavinMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.MailPit 85% 50% 22
CommunityToolkit.Aspire.Hosting.McpInspector 75% 39% 150
CommunityToolkit.Aspire.Hosting.Meilisearch 71% 57% 58
CommunityToolkit.Aspire.Hosting.Minio 88% 75% 56
CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 96% 83% 36
CommunityToolkit.Aspire.Hosting.MySql.Extensions 100% 88% 78
CommunityToolkit.Aspire.Hosting.Ngrok 52% 35% 82
CommunityToolkit.Aspire.Hosting.Ollama 65% 70% 200
CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector 78% 61% 77
CommunityToolkit.Aspire.Hosting.PapercutSmtp 81% 50% 18
CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions 99% 89% 84
CommunityToolkit.Aspire.Hosting.Python.Extensions 39% 32% 90
CommunityToolkit.Aspire.Hosting.RavenDB 62% 48% 148
CommunityToolkit.Aspire.Hosting.Redis.Extensions 100% 71% 48
CommunityToolkit.Aspire.Hosting.Rust 94% 83% 16
CommunityToolkit.Aspire.Hosting.Solr 72% 100% 22
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 52% 49% 206
CommunityToolkit.Aspire.Hosting.Sqlite 89% 89% 52
CommunityToolkit.Aspire.Hosting.SqlServer.Extensions 100% 87% 78
CommunityToolkit.Aspire.Hosting.SurrealDb 55% 40% 256
CommunityToolkit.Aspire.KurrentDB 94% 92% 54
CommunityToolkit.Aspire.MassTransit.RabbitMQ 100% 100% 30
CommunityToolkit.Aspire.Meilisearch 97% 92% 68
CommunityToolkit.Aspire.Microsoft.Data.Sqlite 89% 85% 52
CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite 61% 58% 114
CommunityToolkit.Aspire.Minio.Client 90% 85% 112
CommunityToolkit.Aspire.OllamaSharp 77% 71% 132
CommunityToolkit.Aspire.RavenDB.Client 60% 53% 237
CommunityToolkit.Aspire.SurrealDb 79% 63% 78
Summary 68% (7017 / 10266) 56% (2012 / 3582) 4564

Minimum allowed line rate is 60%

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

@aaronpowell The hack worked!

<ItemGroup>
	<PackageReference Include="Aspire.Hosting.AppHost" Version="13.0.0" />
	<PackageReference Include="Aspire.Hosting.SqlServer" Version="13.0.0" />
	<PackageReference Include="CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects" Version="13.0.0-alpha.2043" />
</ItemGroup>

@dzsquared
Copy link

@dzsquared #949 (comment) - possible to avoid this dependency for a single execption type?

Checking into how tightly coupled Microsoft.Build.dll is with DacFx - but I have recollection that we examined removing it in the recent history and weren't able to.

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 14, 2025

@dzsquared Thanks for checking, I have a proposal to decouple here: #971

@aaronpowell
Copy link
Member

@dzsquared #949 (comment) - possible to avoid this dependency for a single execption type?

Checking into how tightly coupled Microsoft.Build.dll is with DacFx - but I have recollection that we examined removing it in the recent history and weren't able to.

@dzsquared feel free to ping me on Teams - I've dug into some of the stuff and might have some insights into where the issue with DacFx is and what needs to be tackled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants