What is alternative for Microsoft.AspNetCore.Http.Abstractions in .net 6.0 ?

Priya
Priya
Participant
274 Points
62 Posts

I'm looking alternative for package :

    <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0"/>

As now it's deprecated: https://www.nuget.org/packages/Microsoft.AspNetCore.Http.Abstractions/2.2.0?_src=template#readme-body-tab

And causing vulnerbility issue as dependent package: https://www.nuget.org/packages/Microsoft.AspNetCore.Http.Abstractions/2.2.0?_src=template#dependencies-body-tab

  • System.Text.Encodings.Web (>= 4.5.0)

Is there any alternative for Microsoft.AspNetCore.Http.Abstractions in .net 6.0 ?

 

Views: 308
Total Answered: 2
Total Marked As Answer: 2
Posted On: 28-Aug-2023 23:32

Share:   fb twitter linkedin
Answers
Smith
Smith
Moderator
858 Points
169 Posts
         

Add a FrameworkReference instead of a PackageReference as described:

Open .csproj in edit mode and add following section and remove package reference:

<ItemGroup>
  <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Posted On: 28-Aug-2023 23:50
Thanks. Worked for me.
 - Priya  29-Aug-2023 00:15
sam
sam
166 Points
68 Posts
         

Projects that target Microsoft.NET.Sdk or Microsoft.NET.Sdk.Razor SDK, should add an explicit FrameworkReference to Microsoft.AspNetCore.App:

<Project Sdk="Microsoft.NET.Sdk.Razor">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>
    ...
</Project>

See here: https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&tabs=visual-studio#framework-reference

 

Posted On: 29-Aug-2023 00:07
 Log In to Chat