Type or namespace name could not be found (missing using directive or assembly reference?)

大憨熊 提交于 2019-12-25 08:08:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!