-
Notifications
You must be signed in to change notification settings - Fork 252
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
Package should include private lib assets from package ref #5103
Comments
Fixes NuGet/Home#5103 This is only performed for resolved NuGet artifacts that have one of the specified values in the referenced NuGet specification at https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets. This minimizes the impact of the new inference and preserves existing behavior.
This does not work for transitive package references :( |
Ok, it looks like this will need some deeper inspection of the artifacts that nuget generates to determine this, because I'm not sure we're getting all the info we need in plain MSBuild to distinguish them (i.e. no |
When using `<PackageReference PrivateAssets=all `, transitive dependencies were not being brough in. This required package authors to reference explicitly each and every package they wanted packaged as private assets. This was particularly annoying for build and analyzer packages, which need to package all their dependencies privately. This commit leverages the SDK-provided `RunResolvePackageDependencies` which returns the transitive closure of all referenced packages as a list of package>parent list. We use that to add the concept of "implicit package references" that basically share the PrivateAssets=all that brought them in. The inference target then just considers both `@(PackageReference)` as well as `@(ImplicitPackageReference)` to determine the primary output dependencies to pack, but otherwise the existing logic remains unchanged. This behavior still honors the `Pack=false` on the PackageReference, but also skips the implificly defined packages like NETStandard.Library and Microsoft.NETCore. Fixes NuGet/Home#5103.
Full transitive support added in NuGetizer @mhutch. Feel free to close this :) |
Closing per last comment. Also, this issue was for Nugetizer :) |
When building a NuGetizer package, if the project has PackageReferences with PrivateAssets=lib, then those references are copied to the output directory. However, they are not included in the the package.
This is important, for example, for msbuild tasks that depend on other assemblies and need them to be bundled alongside the tasks assembly.
https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets
The text was updated successfully, but these errors were encountered: