Closed brutaldev closed 1 week ago
If you read the message carefully, it's because it's trying to find .NET Framework 9.0 😄 The tfm you need is net9.0
. The existing package works fine 🙂
For some reason I cannot get the preview version to work in an ASP.NET 9 project because of this restore error though. If I revert back to 0.24.0 then for some reason it works.
The build is using .NET 9:
And other packages restore without issue:
I have no idea why the error refers to net90
but that's definitely not coming from my project.
Found the issue, it's because the DevOps build servers have NuGet 4.x installed by default:
Caching tool: NuGet 4.9.6 x64
Found tool in cache: NuGet 4.9.6 x64
Resolved from tool cache: 4.9.6
Using version: 4.9.6
Found tool in cache: NuGet 4.9.6 x64
Detected NuGet version 4.9.6.8 / 4.9.6+a32bce39889f724fbd11cfd12e946f802168b583
Forcing at least NuGet 5.x gets it working:
When using this package with a .NET 9 project you get the error "Package NetEscapades.AspNetCore.SecurityHeaders 1.0.0-preview.2 is not compatible with net90 (.NETFramework,Version=v9.0). Package NetEscapades.AspNetCore.SecurityHeaders 1.0.0-preview.2 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)"