Skip to content

Add multi-targeting example to CPM doc and improve wording #3440

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Jun 13, 2025

Users have asked for examples of how to reference different versions of packages for different target frameworks so this adds one.

I also took the time to clean up some of the wording and I asked Copilot to suggest improvements. You can look at just the first commit for the introduction of the multi-targeting example and the second commit is the cleanup

@Copilot Copilot AI review requested due to automatic review settings June 13, 2025 19:05
@jeffkl jeffkl requested review from a team as code owners June 13, 2025 19:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a multi-targeting example to the Central Package Management documentation and refines the overall wording for improved clarity and consistency.

  • Adds an example demonstrating how to specify different package versions for multiple target frameworks using MSBuild conditions.
  • Updates headings, notes, and example code blocks to enhance readability and accuracy.
Comments suppressed due to low confidence (1)

docs/consume-packages/Central-Package-Management.md:102

  • [nitpick] Consider adding a brief inline comment or note in the code block to clarify that the logical OR condition applies the same version for both 'net8.0' and 'net472', which may help readers who are less familiar with MSBuild conditions.
<PackageVersion Include="PackageA" Version="2.0.0" Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net472'" />

@NuGet NuGet deleted a comment from learn-build-service-prod bot Jun 13, 2025
Copy link

Learn Build status updates of commit 6f32e07:

✅ Validation status: passed

File Status Preview URL Details
docs/concepts/Auditing-Packages.md ✅Succeeded View
docs/consume-packages/Central-Package-Management.md ✅Succeeded View
docs/reference/errors-and-warnings/NU1011.md ✅Succeeded View

For more details, please refer to the build report.

Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

Great changes.
Some suggestions, but only 1 thing I actually feel like needs fixed (transitive pinning header)


## Central Package Management rules
### Using Different Versions for Different Target Frameworks
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if the order of this section and the rules one should be switched.

<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="PackageA" Version="1.0.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
Copy link
Member

Choose a reason for hiding this comment

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

Do you think it's worth calling out that PM UI and just general add package supported is limited in these multi targeted scenarios?


## Transitive pinning
## Pinning Transitive Packages to Different Versions
Copy link
Member

Choose a reason for hiding this comment

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

This is a little confusing for me now.
I liked the previous title much better.

Transitive Pinning is not about different versions in any way, so I feel like that should be taken out of the title.

It's also a bit of a keyword as well.

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.

2 participants