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

Priya
Priya
Participant
1062 Points
29 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: 3056
Total Answered: 3
Total Marked As Answer: 2
Posted On: 28-Aug-2023 23:32

Share:   fb twitter linkedin
great! thanks.
 - checkme  10-Feb-2024 00:44
Answers
Smith
Smith
Participant
2728 Points
76 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
Thanks. helpful...
 - Raj  25-Oct-2023 06:08
sam
sam
Member
378 Points
48 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
Raj
Raj
Member
574 Points
24 Posts
         

Great! works for me too.

Posted On: 10-Feb-2024 00:37
 Log In to Chat