Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
#19847 moved bundled NuGet operations into the Native AOT aspire CLI. NuGet.Client 7.12.0-rc.25, which the CLI now consumes, still reaches Newtonsoft.Json on some paths, so src/Aspire.Cli/Aspire.Cli.csproj carries temporary workarounds to keep the Native AOT publish clean:
RuntimeHostConfigurationOption items that disable Newtonsoft's Newtonsoft.Json.Linq.JToken.SerializationIsSupported, ComponentModelIsSupported, and DynamicIsSupported feature switches.
- The
ConfigureTrimming target, which collapses the remaining dynamic-dispatch warnings from Microsoft.CSharp and System.Linq.Expressions to one warning per assembly.
IL2104;IL3053 in NoWarn, which suppresses those collapsed single-warn diagnostics.
These are only needed until NuGet removes its Newtonsoft.Json dependency from the code paths the CLI uses. Upstream that work is NuGet/NuGet.Client#7601.
The Newtonsoft switches also make the disabled code paths throw NotSupportedException at runtime, so any NuGet update that starts reaching one of them would fail at runtime rather than at publish time.
Describe the solution you'd like
Once NuGet/NuGet.Client#7601 ships in a NuGet.Client release:
- Update
NuGetPackageVersionForCli in eng/Versions.props to that release.
- Remove the three Newtonsoft
RuntimeHostConfigurationOption items, the ConfigureTrimming target, and IL2104;IL3053 from NoWarn in src/Aspire.Cli/Aspire.Cli.csproj.
- Confirm a fresh Native AOT publish of
Aspire.Cli reports no IL trim/AOT diagnostics without them. ILC is incremental, so delete artifacts/obj/Aspire.Cli/<config>/<tfm>/<rid>/native first or a repeat publish can report zero diagnostics without recompiling.
NuGet.UseSystemTextJsonDeserialization may still be required after that change; keep or remove it based on NuGet's AOT guidance at the time.
Additional context
Tracked for 14.0 so the workarounds are not left in place after the upstream fix ships.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
#19847 moved bundled NuGet operations into the Native AOT
aspireCLI. NuGet.Client7.12.0-rc.25, which the CLI now consumes, still reaches Newtonsoft.Json on some paths, sosrc/Aspire.Cli/Aspire.Cli.csprojcarries temporary workarounds to keep the Native AOT publish clean:RuntimeHostConfigurationOptionitems that disable Newtonsoft'sNewtonsoft.Json.Linq.JToken.SerializationIsSupported,ComponentModelIsSupported, andDynamicIsSupportedfeature switches.ConfigureTrimmingtarget, which collapses the remaining dynamic-dispatch warnings fromMicrosoft.CSharpandSystem.Linq.Expressionsto one warning per assembly.IL2104;IL3053inNoWarn, which suppresses those collapsed single-warn diagnostics.These are only needed until NuGet removes its Newtonsoft.Json dependency from the code paths the CLI uses. Upstream that work is NuGet/NuGet.Client#7601.
The Newtonsoft switches also make the disabled code paths throw
NotSupportedExceptionat runtime, so any NuGet update that starts reaching one of them would fail at runtime rather than at publish time.Describe the solution you'd like
Once NuGet/NuGet.Client#7601 ships in a NuGet.Client release:
NuGetPackageVersionForCliineng/Versions.propsto that release.RuntimeHostConfigurationOptionitems, theConfigureTrimmingtarget, andIL2104;IL3053fromNoWarninsrc/Aspire.Cli/Aspire.Cli.csproj.Aspire.Clireports no IL trim/AOT diagnostics without them. ILC is incremental, so deleteartifacts/obj/Aspire.Cli/<config>/<tfm>/<rid>/nativefirst or a repeat publish can report zero diagnostics without recompiling.NuGet.UseSystemTextJsonDeserializationmay still be required after that change; keep or remove it based on NuGet's AOT guidance at the time.Additional context
Tracked for 14.0 so the workarounds are not left in place after the upstream fix ships.