question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow Pack to pin only project references

See original GitHub issue

Description

Currently, the pack command allows for specifying lock-dependencies to force all generated dependencies to be specific (picked up from the paket.lock file) rather than use the version specification from the paket.dependencies file.

However, the version specification of generated project reference dependencies is also controlled by this setting. If lock-dependencies is specified, the project reference versions are pinned (=), but if it is not specified, they are minimums (>=). A new setting could be introduced (pinned-project-references) to allow for the project references to be pinned while still using the version specification from paket.dependencies for any external dependencies.

Repro steps

This is a feature request.

Expected behavior

The two settings lock-dependencies and pinned-project-references would work together as follows:

Neither pinned-project-references nor lock-dependencies specified: External dependencies: Version specification picked up from paket.dependencies. Project references: Version specification is minimum (>=).

pinned-project-references is specified, but lock-dependencies is not specified: External dependencies: Version specification picked up from paket.dependencies. Project references: Version specification is pinned (=).

lock-dependencies is specified (pinned-project-references does not matter): External dependencies: Version specification picked up from paket.lock (pinned). Project references: Version specification is pinned (=).

Actual behavior

Either external dependencies and project references must both be pinned, or neither be pinned.

Known workarounds

There is no known workaround.

Related information

N/A

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
jam40jeffcommented, Jul 26, 2016

Revisiting the discussion above, I do not believe a more complex setting for controlling project dependencies should be pursued. In the interest of keeping things simple, I believe this setting alone (on or off) allows for the two most common scenarios to be handled automatically when using automatic dependencies inferred from project references.

If projects within a solution are guaranteed to maintain backwards compatibility, then the default setting (pin-project-references not being specified) yields the current behavior, which is desired.

However, if backwards compatibility between the projects within a solution is not guaranteed, then a user upgrading a package for one of the projects should be forced to upgrade to the corresponding version for any other packages built from the same solution to ensure they all stay in sync. The (=) specification is the only way to enforce this, and would be able to be specified using this new pin-project-references setting.

0reactions
enricosadacommented, Jan 24, 2018

The pin-project-references is working great. It’s just what we needed. Thanks to all involved!

Closing

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet pack project references
A possible way to achieve the needed is to use a custom .nuspec file where you can specify the dlls you want to...
Read more >
The paket.dependencies file
It contains top level dependencies from all projects in the solution, while paket.references file specifies dependencies for particular project. To give you ...
Read more >
Introducing Central Package Management - The NuGet Blog
Central Package Management. Dependency management is a core feature of NuGet. Managing dependencies for a single project can be easy.
Read more >
Feature : Allow project reference DLLs to be added to the ...
Feature : Allow project reference DLLs to be added to the parent nupkg for pack target like IncludeReferencedProjects in nuget.exe #3891.
Read more >
"donet pack" is not including project references · Issue #6688
I'd really like to just dotnet pack and let the tool figure out dependencies and metadata and stuff, but I unfortunately cannot do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found