Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web API not being recognized on my machine

I've pulled down a project onto my my machine that is using Web API. When I look at the nugget window it shows that I have web api 2.2, the web host, the core libraries, the client libraries, the cross origin support, and Data v 1-3.

However, when I try to build the project, I'm given the following errors:

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

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

Any help you guys and gals can give will be appreciated.

like image 203
will Avatar asked Apr 11 '26 16:04

will


1 Answers

I've had the same issue after I had Resharper add the CORS reference.

I fixed it by adding the correct nuget packages: Microsoft.AspNet.Cors and Microsoft.AspNet.WebApi.Cors.

like image 128
Nic Avatar answered Apr 13 '26 06:04

Nic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!