respect central package management when adding aspire integration to AppHost#14875
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14875Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14875" |
|
@Muckenbatscher can you open ths against the release/13.2 branch? |
2a2d65d to
31fbbe9
Compare
|
@dotnet-policy-service agree |
31fbbe9 to
d19920e
Compare
|
THANK you - this is a great contrib!! @mitchdenny lets get this reviewed + merged for 13.2! |
05c6861 to
e33fa2b
Compare
|
The first approach was flawed. This would fail for packages that have (transitive) dependencies on other packages that are only available in a different source. |
|
I tested locally and it works. I'll see if I can fix conflicts and get tests working. |
…AppHost * pass the source of the selected package if no source is explicitly passed as argument * so that the --no-restore flag is not appended to the dotnet CLI arguments. This flag effectively bypasses the CPM and adds the PackageReference with Version attribute directly to the AppHost.csproj instead of the Directory.Packages.props file.
instead provide an explicit parameter to toggle the restore validation performed by the dotnet CLI
for combining --source and --no-restore options independently
1c42ef9 to
ee09cc2
Compare
|
Primary finding
Analysis of the fix Implemented fix in
Regression coverage added
Result
|
|
Details for commit This commit contains the targeted fix for the failing E2E scenario by changing non-interactive package version selection behavior in What changed
Why this matters
Test coverage added in same commit
|
|
@Muckenbatscher Thanks for this PR, it's a really impactful one! |
…AppHost (#14875) Co-authored-by: James Newton-King <james@newtonking.com>
…AppHost (#14875) Co-authored-by: James Newton-King <james@newtonking.com>
Description
Previously when running
aspire add [integration-name]thePackageReferenceelement with aVersionattribute would be added to theAppHost.csprojdirectly.When Central Package Management is in place this will lead to a build error NU1008.
The
PackageReferenceis added to theAppHost.csprojdirectly because the--no-restoreflag is passed to the dotnet CLI when no source is explicitly specified foraspire add. This effectively tells the dotnet CLI to skip the validation that is required for adding thePackageVersionto theDirectory.Packages.props.So if no source is explicitly specified to the
aspire addcommand pass the one, where the integration NuGet package was found in (for most cases this will be the nuget.org source).Fixes #13241
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: