Skip to content
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

provide a way to suppress dependencies in dotnet pack #6354

Closed
rohit21agrawal opened this issue Dec 22, 2017 · 2 comments
Closed

provide a way to suppress dependencies in dotnet pack #6354

rohit21agrawal opened this issue Dec 22, 2017 · 2 comments
Assignees
Labels
Functionality:Pack Priority:1 High priority issues that must be resolved in the current sprint. Type:DCR Design Change Request
Milestone

Comments

@rohit21agrawal
Copy link
Contributor

have an option to suppress all package references and framework assembly references in the output nupkg .

this is required for scenarios where package authors publish all their dependencies into the package itself (especially for tools package) and so do not need any dependency in the nuspec itself.

@rohit21agrawal
Copy link
Contributor Author

closing this. Currently this can be achieved by setting Publish=true along with PrivateAssets=all

To apply it to every Package Reference, yo can use an ItemDefinitionGroup that does this.

@rohit21agrawal
Copy link
Contributor Author

from @wli3
The default behavior of dotnet pack is to change package reference to dependency in nuspec. But the nupkg of global tools does not have package reference.
One way I found while still use dotnet pack is to change all PackageReference to PrivateAssets=all. However that breaks test project. Since the main project’s dependency cannot be accessed by the test project. And the only way to alter the dependency in dotnet pack is changing asset.json.
relate issue:
dotnet/cli#9109

@rohit21agrawal rohit21agrawal modified the milestones: 4.7, 4.8 Apr 23, 2018
@rrelyea rrelyea added Type:Feature Type:DCR Design Change Request and removed Type:Feature labels Sep 6, 2018
kzu added a commit to devlooped/nugetizer that referenced this issue Mar 28, 2021
…erty

From NuGet/Home#6354, the SuppressDependenciesWhenPacking property can turn off package reference and framework reference dependencies inference in SDK pack.

This adds compatibility behavior that turns off packing of PackageReference by default when that flag is true, as well as framework references.

The individual package references can still opt in even when the setting is true.

Fixes #67
kzu added a commit to devlooped/nugetizer that referenced this issue Mar 28, 2021
…erty

From NuGet/Home#6354, the SuppressDependenciesWhenPacking property can turn off package reference and framework reference dependencies inference in SDK pack.

This adds compatibility behavior that turns off packing of PackageReference by default when that flag is true, as well as framework references.

The individual package references can still opt in even when the setting is true.

Fixes #67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Pack Priority:1 High priority issues that must be resolved in the current sprint. Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

2 participants