找不到类型或名称空间名称(缺少使用指令或程序集引用吗?) [英] Type or namespace name could not be found (missing using directive or assembly reference?)

查看:193
本文介绍了找不到类型或名称空间名称(缺少使用指令或程序集引用吗?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下代码:

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

我得到了错误:

找不到类型或名称空间名称'IHttpActionResult'(是 您缺少using指令或程序集引用吗?)

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

此处所示,IHttpActionResult接口在System.Web.Http中定义.

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

怎么了?

推荐答案

解决了此问题(严格与参考管理器"中指定:

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

这篇关于找不到类型或名称空间名称(缺少使用指令或程序集引用吗?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆