-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Ad central package management #97
Conversation
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> | ||
|
||
<!-- Global Package References --> | ||
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" /> |
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.
PrivateAssets="all"
probably has no effect here
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.
"here", do you mean because Microsoft.SourceLink.GitHub doesn't need it? GlobalPackageReference
actually maintains it, had to learn since you taught me that it didn't have any effect in the PackageVersion tags. https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management#global-package-references
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.
And double-checked, SourceLink requires the PrivateAssets attribute (was obvious)
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.
Well from Jint's viewpoint...
Deps in Packages.props:
No deps on actual artifact:
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 I found the explanation:
Source Link package is a development dependency, which means it is only used during build. It is therefore recommended to set PrivateAssets to all on the package reference. This prevents consuming projects of your nuget package from attempting to install Source Link.
Referencing any Source Link package in a .NET SDK 8+ project suppresses Source Link that is included in the SDK.
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.
Yes, generally any <GlobalPackageReference>
is kind of a fire-and-forget, it won't/shouldn't be present in actual package
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.
A reason I like to have them in a separate <ItemGroup>
as they behave differently
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.
Keeping it, for safety
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.
Like you said. I asked internally to understand how it's done and what is the recommendation.
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 only understand your comment now, fixing ...
No description provided.