-
Notifications
You must be signed in to change notification settings - Fork 488
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
Specify that PrivateAssets="all" also affects Publish Fixes #3270 #3291
Open
Forgind
wants to merge
1
commit into
NuGet:main
Choose a base branch
from
Forgind:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
Is this documented anywhere on the SDK side?
Personally, I've always thought this was an incorrect decision that we unfortunately can't roll back, but it is still an SDK side decision, not NuGet. So I think the NuGet docs should reference an SDK side explanation.
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.
I don't think it's documented anywhere. I'm not sure where the code that does this is, but I imagine most customers who are looking for something like PrivateAssets="all" will find the NuGet docs, so I think we do need to mention it here.
I don't know where I'd add that in any SDK docs, so although I'm not against having it there somewhere there and having a link to that here, I'd probably have to dig around a bit to find where an appropriate place might be—unless you already have somewhere in mind for that?
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.
I think publish docs should have it.
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.
Are you talking about https://learn.microsoft.com/dotnet/core/deploying/? I don't see anything that connects to how metadata (like PrivateAssets) would affect publishing...since that page was mostly talking about high-level things (what can you pass to the publish command), I feel like this would belong on a different page, but I didn't see anything better.
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.
I think any doc that may be talking about publish actually does.
The PackageReference attribute Publish is a publish first thing, not a PackageReference first thing.
It never flows through the assets file.
PrivateAssets means what my consumers get, it never affects what gets consumed at build time. You can take a compile time or runtime dependency on a package that you've marked with PrivateAssets.
ExcludeAssets/IncludeAssets handle whether you're allowed to take that dependency.
Publish is different from build.
That being said, i think this discussion is related to dotnet/sdk#39400 now.
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.
My understanding from that discussion is that this is still correct and unlikely to change. I couldn't find anywhere on the SDK side that documented any part of this scenario. Are you ok with merging this?