简体   繁体   中英

Could not be found

When I use the EntityFramework.Extended in my RiceBuySellProvider project, I got this error in my main project :

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

From MainProject Image 在此处输入图片说明

But when I remove the .FutureFirstOrDefault() of EntityFramework.Extended from my RiceBuySellProvider and no errors found. Why?

UPDATE

When I use the .FutureFirstOrDefault() this will be the cause of the error.

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

You need to add a reference to the assembly that holds the namespace you are importing.

Project Properties > Refernces


Its possible that the Rice assembly targets an incompatible framework, or that its bittyness (x86 / x64) is mismatched.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM