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

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!



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RezA