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和项目之间很可能存在不兼容。