Conversation
## Summary - Add a pack-time normalization target in `Krypton.Standard.Toolkit.csproj` to align nuspec framework aliases with package `lib/ref` folder names. - Ensure generated dependency groups include exact matches for: - `net8.0-windows7.0` - `net9.0-windows7.0` - `net10.0-windows7.0` - `net11.0-windows7.0` - `.NETFramework4.7.2` - `.NETFramework4.8` - `.NETFramework4.8.1` - Prevent framework mismatch warnings (for example `NU5128`) caused by non-aligned TFM naming between dependency groups and packaged assets. ## Why Nightly packaging produced dependency-group TFMs that did not exactly match the framework names used in packaged `lib/ref` paths. This causes NuGet analysis warnings and can lead to incorrect framework asset resolution. ## Implementation Details - Hook `NormalizePackTargetFrameworkAliases` into `GenerateNuspecDependsOn`. - Remap pack metadata framework identifiers before nuspec generation: - `net472` -> `.NETFramework4.7.2` - `net48` -> `.NETFramework4.8` - `net481` -> `.NETFramework4.8.1` - `net8.0-windows` -> `net8.0-windows7.0` - `net9.0-windows` -> `net9.0-windows7.0` - `net10.0-windows` -> `net10.0-windows7.0` - `net11.0-windows` -> `net11.0-windows7.0` - Apply the same alias mapping to: - `_TargetFrameworks` - `_FrameworksWithSuppressedDependencies` - `_FrameworkAssemblyReferences` (metadata `TargetFramework`) ## Test Plan - [x] Run pack for `Krypton.Standard.Toolkit` with nightly/all-TFM settings. - [x] Inspect generated nuspec in the resulting package. - [x] Confirm dependency groups exist for all expected framework aliases listed above. - [x] Confirm no linter errors in the edited project file. ## Notes - This change only affects pack-time metadata generation and does not change compile-time target frameworks.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Krypton.Standard.Toolkit.csprojto align nuspec framework aliases with packagelib/reffolder names.net8.0-windows7.0net9.0-windows7.0net10.0-windows7.0net11.0-windows7.0.NETFramework4.7.2.NETFramework4.8.NETFramework4.8.1NU5128) caused by non-aligned TFM naming between dependency groups and packaged assets.Why
Nightly packaging produced dependency-group TFMs that did not exactly match the framework names used in packaged
lib/refpaths. This causes NuGet analysis warnings and can lead to incorrect framework asset resolution.Implementation Details
NormalizePackTargetFrameworkAliasesintoGenerateNuspecDependsOn.net472->.NETFramework4.7.2net48->.NETFramework4.8net481->.NETFramework4.8.1net8.0-windows->net8.0-windows7.0net9.0-windows->net9.0-windows7.0net10.0-windows->net10.0-windows7.0net11.0-windows->net11.0-windows7.0_TargetFrameworks_FrameworksWithSuppressedDependencies_FrameworkAssemblyReferences(metadataTargetFramework)Test Plan
Krypton.Standard.Toolkitwith nightly/all-TFM settings.Notes