Skip to content

* NUSPEC Fixes#3327

Merged
PWagner1 merged 1 commit intoalphafrom
alpha-warning-fixes
Apr 19, 2026
Merged

* NUSPEC Fixes#3327
PWagner1 merged 1 commit intoalphafrom
alpha-warning-fixes

Conversation

@PWagner1
Copy link
Copy Markdown
Contributor

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

  • Run pack for Krypton.Standard.Toolkit with nightly/all-TFM settings.
  • Inspect generated nuspec in the resulting package.
  • Confirm dependency groups exist for all expected framework aliases listed above.
  • 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.

## 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.
@PWagner1 PWagner1 added this to the Version 110 milestone Apr 16, 2026
@PWagner1 PWagner1 requested a review from a team as a code owner April 16, 2026 15:22
@PWagner1 PWagner1 added nuget issue All NuGet issues. version:110 All things to do with V110. labels Apr 16, 2026
@PWagner1 PWagner1 merged commit b16aa63 into alpha Apr 19, 2026
8 of 9 checks passed
@PWagner1 PWagner1 deleted the alpha-warning-fixes branch April 19, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nuget issue All NuGet issues. version:110 All things to do with V110.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant