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.

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

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
@aaronpowell
Copy link
Member

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

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.

@aaronpowell
Copy link
Member

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

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.

@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

@aaronpowell aaronpowell merged commit b43f9d5 into main Nov 15, 2025
210 of 211 checks passed
@aaronpowell aaronpowell deleted the copilot/add-dotnet-10-tfm-support branch November 15, 2025 20:52
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