问题
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
来源:https://stackoverflow.com/questions/39878570/type-or-namespace-name-could-not-be-found-missing-using-directive-or-assembly-r