Type or namespace name could not be found (missing

2019-09-10 19:13发布

问题:

With this code:

using System.Web.Http;
class MyClass : IHttpActionResult
{ ... }

I get the error:

The type or namespace name 'IHttpActionResult' could not be found (are you missing a using directive or an assembly reference?)

As shown here, the IHttpActionResult interface is defined in System.Web.Http.

What is wrong?

回答1:

Fixed this problem (strictly related to this one) specifying in Project > Reference Manager:

Microsoft.Owin  2.0.2.0
Owin  1.0.0.0
System.Net.Http.Formatting  5.2.3.0
System.Web  4.0.0.0
System.Web.Http  5.2.3.0
System.Web.Http.Owin  5.2.3.0