【发布时间】:2014-06-23 18:14:29
【问题描述】:
我得到,“找不到类型或命名空间名称 'INRBQDeliveryRepository'(您是否缺少 using 指令或程序集引用?)”:
public class DeliveryController : ApiController
{
private readonly INRBQDeliveryRepository _deliveryRepository;
我试图引用的接口类型是:
namespace SeaStore.Data.Legacy.Interfaces
{
public interface INRBQDeliveryRepository
. . .
这些是解决方案中的不同项目(NRBQ.Web 正在尝试访问其兄弟 SeaStore.Data.Legacy);添加“使用 SeaStore.Data.Legacy.Interfaces;”使用“未找到”错误阻止编译的类无济于事 - 事实上,我从上面提到的错误转到添加错误,具体来说:
“名称空间“SeaStore”中不存在类型或命名空间名称“Data”(您是否缺少程序集引用?)”在此处的 Controller 类中:
using SeaStore.Data.Legacy.Interfaces;
为什么我的其他项目界面不可见?
【问题讨论】:
-
您是否将您的界面项目中的引用添加到您当前的项目中?
-
如果您在其他项目中有编译错误,那么您也会得到这个。确保修复所有其他错误。
-
@Nick 接口在上面列出的代码示例中是公共的。
标签: c# asp.net-mvc-4 interface projects-and-solutions solution