Target net10.0 in client integrations#12500
Conversation
This is especially important for EF integrations where we need to explicitly reference the 10 version of EF when targeting net10.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12500Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12500" |
There was a problem hiding this comment.
Pull Request Overview
This PR adds .NET 10.0 target framework support and updates package versions to .NET 10.0 RC2. The changes enable the Aspire project to support multi-targeting across .NET 8.0, 9.0, and 10.0.
- Adds
net10.0to theAllTargetFrameworksproperty - Defines preview version properties for .NET 10.0 packages (EF Core, ASP.NET Core, Runtime extensions)
- Maps preview version properties to specific packages for net10.0 target framework
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/Versions.props | Adds net10.0 to target frameworks and defines preview version properties for .NET 10.0 RC2 packages |
| Directory.Packages.props | Maps preview version properties to package references for net10.0 target framework |
|
@sebastienros @DamianEdwards - This is ready for review. |
| private static void AssertCorrectConnectionString(string expectedConnectionString, string actualConnectionString) | ||
| { | ||
| #if NET10_0_OR_GREATER | ||
| // In .NET 10, the connection string may have additional parameters appended, so we check the start only. |
There was a problem hiding this comment.
In .NET 10 or in EF 10. nit but just want to be sure what changed, not asking for changing the comment
There was a problem hiding this comment.
EF changed, as far as I can tell. It started adding the app name to the connection string. I think dotnet/efcore#36548 caused it.
| public class AspireSqlServerEFCoreSqlClientExtensionsTests | ||
| { | ||
| private const string ConnectionString = "Data Source=fake;Database=master;Encrypt=True"; | ||
| private const string ConnectionString = "Data Source=fake;Initial Catalog=master;Encrypt=True"; |
There was a problem hiding this comment.
Is it just nicer or doesn't it work otherwise?
There was a problem hiding this comment.
The test breaks. EF is changing Database to Initial Catalog somewhere. So I updated these strings to match so the test doesn't break.
There was a problem hiding this comment.
It might be some normalizing that SqlClient does. Functionally, there's no difference.
|
/backport to release/13.0 |
|
Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/18970980187 |
This is especially important for EF integrations where we need to explicitly reference the 10 version of EF when targeting net10.
cc @DamianEdwards