fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
1.99k stars 520 forks source link

Could not detect any platforms warning #4239

Open kerams opened 6 months ago

kerams commented 6 months ago

Description

Some packages use nonstandard (?) monikers in nuspec. AWSSDK.Core includes <group targetFramework=".NETCoreApp8.0" />, while Paket supposedly expects net8.0.

Repro steps

Expected behavior

Package added cleanly.

Actual behavior

Warning Could not detect any platforms from '.netcoreapp8.0' in 'C:\Users\goof\.nuget\packages\awssdk.core\3.7.300.4\awssdk.core.nuspec', please tell the package authors, and I assume Paket then doesn't use the net8.0 assembly from the package.

Known workarounds

None.

smoothdeveloper commented 6 months ago

https://learn.microsoft.com/en-us/nuget/reference/target-frameworks#supported-frameworks

yes it seems non standard.

Makes me wonder if we should have unit tests that scrape nuget.org (or basically, calls into the same code used there) to assert we match the same targets as shown on the page, nuget.org shows correct resolution.

smoothdeveloper commented 6 months ago

https://github.com/NuGet/NuGetGallery/blob/e56384290f44bd4cc163cc94eff17bd3e63ac3c2/src/NuGetGallery.Core/Frameworks/PackageFrameworkCompatibilityFactory.cs#L47