11
votes

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

1
For 2.2 you need to install the Microsoft.AspNet.WebApi.Core packagepblack

1 Answers

5
votes

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