Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Web.Http missing in .net Core 2.1

System.Web.Http is missing in my .net core 2.1 project.

the error states

Error CS0234 The type or namespace name 'Http' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

please refer the image for more clarity

Reference

like image 675
Sanjeev S Avatar asked Apr 08 '19 06:04

Sanjeev S


People also ask

Is .NET Core 2.1 still supported?

NET Core 2.1 and . NET Core 3.1 are long-term support versions, which means they're supported for 3 years after release. This is explained in the . NET Core Support Policy.

Can we use System Web in .NET Core?

ASP . NET Core does not support System. Web. dll but supports a collection of granular and well factored NuGet packages.

Is .NET Core 2.2 end of life?

NET Core 2.2 is no longer supported and updates will no longer be provided. We recommend moving to . NET Core 3.1, our long term support (LTS) release.

Is .NET Core 3.1 still supported?

Starting with . NET Core 3.1, end of life dates will align with Microsoft Patch Tuesday (second Tuesday of each month). For example, . NET Core 3.1 was originally released on December 3, 2019 and is supported for three years.


1 Answers

System.Web.Http is not available in dotnet core, but may be referenced by installing the following nuget package: Microsoft.AspNetCore.Mvc.WebApiCompatShim.dll. This will clear the error.

Source: https://docs.microsoft.com/en-us/dotnet/api/system.web.http.httperror?view=aspnetcore-2.1

like image 152
jGroot Avatar answered Sep 19 '22 13:09

jGroot