Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 4.0 找不到_C# 4.0_Entity Framework 4_Entityframework.extended - Fatal编程技术网

C# 4.0 找不到

C# 4.0 找不到,c#-4.0,entity-framework-4,entityframework.extended,C# 4.0,Entity Framework 4,Entityframework.extended,当我在我的RiceBuySellProvider项目中使用时,我在我的主项目中得到了这个错误: The type or namespace name I remove the 'RiceBuySellProvider' could not be found (are you missing a using directive or an assembly reference?) 从MainProjectImage 但是当我从我的RiceBuySellProvider中删除EntityFram

当我在我的
RiceBuySellProvider
项目中使用时,我在我的
主项目中得到了这个错误:

The type or namespace name I remove the 'RiceBuySellProvider' could not be found (are you missing a using directive or an assembly reference?)
MainProject
Image

但是当我从我的
RiceBuySellProvider
中删除
EntityFramework.Extended
.FutureFirstOrDefault()
时,没有发现任何错误。为什么?

更新

当我使用
.FutureFirstOrDefault()
时,这将是错误的原因

public static ProductEntity GetProduct(string productNo)
{
    using (var con = new RiceBuySellEntities(ConnectionStr))
        return CompiledQueries.GetProCatTypeUnit.Invoke(con, productNo).FutureFirstOrDefault();
}

您需要添加对保存要导入的命名空间的程序集的引用

项目属性>引用

编辑

可能是Rice程序集以不兼容的框架为目标,或者其位(x86/x64)不匹配。

是的,当然我们需要引用
.dll
。但是请试着弄清楚我的问题:)不,你弄清楚你的问题,然后问你的意思。扮演通灵师不是我的工作,好吧。很好,显然,
RiceBuySellProvider
已经在我的主要项目中。这就是为什么我想知道我得到了这个错误
:D
+1它可能是。但这很奇怪。为什么在我使用
EntityFramework.Extended的
.FutureFirstOrDefault()
时发生此错误?您可能是对的。dll和项目之间很可能存在不兼容。