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

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

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

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

@ErikEJ @jmezach either of you able to look at the SQL db project errors - https://github.com/CommunityToolkit/Aspire/actions/runs/19286737811/job/55149036924?pr=949#step:6:88

Could it be because the SDK package isn't supporting .NET 10?

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 12, 2025

@aaronpowell The 3.2.0 SDK supports .NET 10 just fine. Not sure what is specific about the single failing test?

@jmezach Thoughts?

@aaronpowell
Copy link
Member

@aaronpowell The 3.2.0 SDK supports .NET 10 just fine. Not sure what is specific about the single failing test?

@jmezach Thoughts?

Oh bugger. I saw something on the sdk repo about cutting a release, thought it might be related

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 12, 2025

@aaronpowell Ah, we have used .NET 10 SDK for a few months now, the issue was just about cutting a release based on the RTM SDK and with the latest DacFX package, for the best SQL Server 2025 support

@jmezach
Copy link
Contributor

jmezach commented Nov 12, 2025

@ErikEJ @aaronpowell I'm wondering if this might be related to the Microsoft.Build.Locator package that we're using to find an MSBuild instance on the local machine in order to read the project file. Perhaps we need to update that package as well in order to support .NET 10 here?

@aaronpowell
Copy link
Member

Which package is that?

@jmezach
Copy link
Contributor

jmezach commented Nov 12, 2025

@aaronpowell https://www.nuget.org/packages/Microsoft.Build.Locator. It is referenced here:

<PackageVersion Include="Microsoft.Build.Locator" Version="1.10.2" />

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 12, 2025

@jmezach But is that not the latest version already?

@jmezach
Copy link
Contributor

jmezach commented Nov 12, 2025

1.10.12 is the latest version, we're currently using 1.10.2

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 12, 2025

@jmezach Ah - number blindness! 😄

@aaronpowell
Copy link
Member

Ah, thought I'd bumped it. Wanna bump to latest and see what CI dpes

@@ -1,6 +1,5 @@
<Project Sdk="MSBuild.Sdk.SqlProj/3.2.0">
<PropertyGroup>
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
Copy link
Member

@Alirexaa Alirexaa Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change likely caused the test failure. We encountered a similar issue with .NET 9 support last year; multi-targeting was incompatible with SqlProj then.

#182 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this needs to remain

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's my bad, I was doing a bunch of stuff trying to force target frameworks and forgot what I had done

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.

5 participants