respect central package management when adding aspire integration to AppHost#14875
Open
Muckenbatscher wants to merge 4 commits intodotnet:release/13.2from
Open
respect central package management when adding aspire integration to AppHost#14875Muckenbatscher wants to merge 4 commits intodotnet:release/13.2from
Muckenbatscher wants to merge 4 commits intodotnet:release/13.2from
Conversation
Contributor
|
🚀 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" |
Member
|
@Muckenbatscher can you open ths against the release/13.2 branch? |
2a2d65d to
31fbbe9
Compare
Author
|
@dotnet-policy-service agree |
31fbbe9 to
d19920e
Compare
This was referenced Mar 3, 2026
Member
|
THANK you - this is a great contrib!! @mitchdenny lets get this reviewed + merged for 13.2! |
…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.
d19920e to
05c6861
Compare
instead provide an explicit parameter to toggle the restore validation performed by the dotnet CLI
05c6861 to
e33fa2b
Compare
Author
|
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. |
for combining --source and --no-restore options independently
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: