"Http" and "Mvc" Does not Exist in the Namespace "System.Web"

2.1k Views Asked by At

I'm trying to run a web app, but I have problem with the API as Http and Mvc Does not Exist in the Namespace System.Web in Visual Studio 2019.

using System.Web.Http;
using System.Web.Mvc;

But as I've checked the references, they are already there as shown below:

enter image description here

I've tried deleting them from the packages folder and restore them again, restarting my computer and VS 2019 and lastly reinstalling VS 2019 but the issue still persists. Can someone help me with this? Thanks!

1

There are 1 best solutions below

0
On

If you want to get System.Web.Http, you need to install the package "Microsoft.AspNet.WebApi" from Nuget.

  1. Open Tools>NuGet Package Manager>NuGet Package Manager for Solution
  2. Click Browse tab and type "Microsoft.AspNet.WebApi"
  3. Choose the package and then check your project name at the right column
  4. Click Install