While working on some class library code in C#, I noticed deprecation warnings in Visual Studio for the following NuGet packages:
- NuGet Gallery | Microsoft.AspNetCore.Http.Abstractions 2.2.0
- NuGet Gallery | Microsoft.AspNetCore.Authentication.Abstractions 2.2.0
A look at the NuGet website confirmed this:
But what now? It looked like that no alternative was mentioned anywhere…
I first tried to just remove these 2 packages but now my library no longer compiled!?
In the end I was able to solve it by adding a framework reference to Microsoft.AspNetCore.app inside the csproj file of my class library:
This file contains 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
<ItemGroup> | |
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | |
</ItemGroup> |