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

Add best practice to Package-Versioning.md #3353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ericstj
Copy link
Contributor

@ericstj ericstj commented Nov 13, 2024

@ericstj ericstj requested review from a team as code owners November 13, 2024 16:59
Copy link

Learn Build status updates of commit 770f5ab:

✅ Validation status: passed

File Status Preview URL Details
docs/concepts/Package-Versioning.md ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@aortiz-msft aortiz-msft self-requested a review November 13, 2024 19:14
@@ -116,9 +116,10 @@ When referring to package dependencies, NuGet supports using interval notation f
| [1.0,2.0) | 1.0 ≤ x < 2.0 | Mixed inclusive minimum and exclusive maximum version |
| (1.0) | invalid | invalid |

### Examples
### Best Practice

Always specify a version or version range for package dependencies in project files, `packages.config` files, and `.nuspec` files. Without a version or version range, NuGet 2.8.x and earlier chooses the latest available package version when resolving a dependency, whereas NuGet 3.x and later chooses the lowest package version. Specifying a version or version range avoids this uncertainty.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NuGet 2.8.x is out of support. Let's remove the whole of line 121.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still important to specify a version. I know PackageReference requires it. I see nuspecs still allow dependencies without a version. I think this can be reworded and avoid the mention of 2.8.x.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Suggested change
Always specify a version or version range for package dependencies in project files, `packages.config` files, and `.nuspec` files. Without a version or version range, NuGet 2.8.x and earlier chooses the latest available package version when resolving a dependency, whereas NuGet 3.x and later chooses the lowest package version. Specifying a version or version range avoids this uncertainty.
Always specify a version or version range for package dependencies in project files, `packages.config` files, and `.nuspec` files. Without a version or version range, when resolving a dependency, consistent restore results are not guaranteed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants