EntityFramework-Plus icon indicating copy to clipboard operation
EntityFramework-Plus copied to clipboard

When use EFCore In ConsoleApp ,a "FileNotFoundException" occurred.

Open LyricsYo opened this issue 10 years ago • 5 comments

Code just like this: EFCoreDbContext ctx = new EFCoreDbContextFactory().Create(); var query=ctx.Movies.DeferredCount();

LyricsYo avatar Jun 04 '16 16:06 LyricsYo

Can you post the full Stack Trace (or send it by email if you want to keep it private)?

The DeferredCount only defer the query and doesn't execute it unless you call the method. Using the code you posted, I cannot reproduce this issue without more information.

ghost avatar Jun 04 '16 16:06 ghost

System.IO.FileNotFoundException was unhandled FileName=EntityFramework.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 HResult=-2147024894 Message=Could not load file or assembly 'EntityFramework.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. 系统找不到指定的文件。 Source=Z.EntityFramework.Plus.EFCore StackTrace: at Z.EntityFramework.Plus.QueryDeferred1..ctor(IQueryable query, Expression expression) at Z.EntityFramework.Plus.QueryDeferredExtensions.DeferredCount[TSource](IQueryable1 source) at HelloEFCore.Program.Main(String[] args) in C:\Programming\Demos\HelloEFCore\src\HelloEFCore\Program.cs:line 16 InnerException:

LyricsYo avatar Jun 04 '16 16:06 LyricsYo

Judging by the error, you probably use a different version of EntityFramework.Core from the one (EFCore R1) used to build the EF+ library.

If you already use EFCore R2, we are currently migrating all our project to this version. We hope to release all versions next week.

ghost avatar Jun 04 '16 16:06 ghost

Yes, I did use EFCore RC2.

Thanks for your reply.

LyricsYo avatar Jun 04 '16 16:06 LyricsYo

Hello xbuilder,

Just to let you know, the version 1.2.0 supporting RC2 is now released.

ghost avatar Jun 08 '16 18:06 ghost