Refactor PackageVersions and dependencies#7037
Merged
eerhardt merged 3 commits intomicrosoft:mainfrom Jan 11, 2025
Merged
Conversation
joperezr
reviewed
Jan 8, 2025
joperezr
reviewed
Jan 8, 2025
|
|
||
| <!-- The following 2 groups are for packages that need to switch based on the .NET TFM being used. --> | ||
|
|
||
| <ItemGroup> |
Member
There was a problem hiding this comment.
NIT: Should this be conditioned as well for net8 tfm?
Member
Author
There was a problem hiding this comment.
My thinking was that these are unconditional, and then the "STS" version "updates" the PackageVersion. Either way could work, I don't have strong opinion. Do you?
joperezr
approved these changes
Jan 8, 2025
Member
joperezr
left a comment
There was a problem hiding this comment.
Couple of questions but looks great overall. Thanks!
In the dotnet/aspire repo today, the way we switch out dependency versions between net8 and net9 doesn't work if you only target a single TFM - net9.0. This is because we have an MSBuild Property condition based on TargetFramework, which isn't set at property evaluation time. To fix this, refactor the condition to be an ItemGroup condition on TargetFramework, which gets evaluated after properties get set, so TargetFramework is set. This follows the same approach used in dotnet/extensions. - To also follow dotnet/extensions (and so the property names aren't so long), I changed the PackageVersion suffix to just Version.
4e3334d to
ba1000f
Compare
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the dotnet/aspire repo today, the way we switch out dependency versions between net8 and net9 doesn't work if you only target a single TFM - net9.0. This is because we have an MSBuild Property condition based on TargetFramework, which isn't set at property evaluation time.
To fix this, refactor the condition to be an ItemGroup condition on TargetFramework, which gets evaluated after properties get set, so TargetFramework is set. This follows the same approach used in dotnet/extensions.