EF Core Query

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Query

Post by Shalex » Mon 10 Jul 2017 17:11

guinness wrote:

Code: Select all

7.0.7-m61        7.0.7.0          MySql.Data.EntityFrameworkCore.dll
It references Microsoft.EntityFrameworkCore, Version=1.1.0.0.

JIC: please create a new simple console project. Run the following command via Package Manager Console:

Code: Select all

PM> install-package MySql.Data.EntityFrameworkCore -pre
This will download MySql.Data.EntityFrameworkCore.dll itself and all its dependencies. Please use these dependencies via a standalone Entity Developer and the one embedded in VS2017.

Does this help?

guinness
Posts: 25
Joined: Tue 22 Nov 2016 03:19

Re: EF Core Query

Post by guinness » Wed 12 Jul 2017 02:04

@Shalex I tried to downgrade to 1.1.0 but still no joy. Below are the assemblies referenced now:

Code: Select all

ProductVersion   FileVersion      FileName
--------------   -----------      --------
1.1.0-rtm-22752  1.1.0.21115      Microsoft.EntityFrameworkCore.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.EntityFrameworkCore.Relational.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Caching.Abstractions.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Caching.Memory.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.DependencyInjection.Abstractions.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.DependencyInjection.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Logging.Abstractions.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Logging.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Options.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Primitives.dll
7.0.7-m61        7.0.7.0          MySql.Data.dll
7.0.7-m61        7.0.7.0          MySql.Data.EntityFrameworkCore.dll
2.1.1+Release... 2.1.1.30000      Remotion.Linq.dll
4.6.24705.01.... 4.6.24705.01     System.Collections.Immutable.dll
4.6.24705.01.... 4.6.24705.01     System.Diagnostics.DiagnosticSource.dll
3.0.0+Branch.... 3.0.0.0          System.Interactive.Async.dll
4.6.24705.01.... 4.6.24705.01     System.Linq.Expressions.dll
It didn't work for me, but maybe gmilczarek will have better luck. Is it possible that you can share the assembly names & versions from the system that you have working? That would certainly make the environment easier to mimic.

Code: Select all

Get-ChildItem -Filter *.dll -Recurse | Select-Object -ExpandProperty VersionInfo

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Query

Post by Shalex » Tue 18 Jul 2017 09:37

Looks like the package MySql.Data.EntityFrameworkCore is updated. We will investigate the changes and notify you about the result.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Query

Post by Shalex » Wed 02 Aug 2017 18:42

We are getting the following error with MySql.Data.EntityFrameworkCore v8.0.8-dmr in both design time and runtime:

Could not load file or assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. Strong name validation failed.

This problem occured in the past as well: https://forums.mysql.com/read.php?38,650219,650868. We think the issue is caused by incorrect signing.

guinness
Posts: 25
Joined: Tue 22 Nov 2016 03:19

Re: EF Core Query

Post by guinness » Thu 03 Aug 2017 21:36

Thanks, I can confirm that version 8.0.8-dmr were not signed whereas version 7.0.7-m61 was.

However I don't think that is the root cause for the issue. Even when I removed MySQL and instead tried the SQLite provider (which is signed) it still gave me the same error.

Below are the core assembly files I'm now using. Are you able to reproduce with this setup? Is there any additional logging I can enable at my end?

Code: Select all

ProductVersion   FileVersion      FileName
--------------   -----------      --------
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Data.Sqlite.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.EntityFrameworkCore.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.EntityFrameworkCore.Relational.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.EntityFrameworkCore.Sqlite.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Caching.Abstractions.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Caching.Memory.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.DependencyInjection.Abstractions.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.DependencyInjection.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Logging.Abstractions.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Logging.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Options.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Primitives.dll
2.1.1+Release... 2.1.1.30000      Remotion.Linq.dll
4.6.24705.01.... 4.6.24705.01     System.Collections.Immutable.dll
4.6.24705.01.... 4.6.24705.01     System.Diagnostics.DiagnosticSource.dll
3.0.0+Branch.... 3.0.0.0          System.Interactive.Async.dll
4.6.24705.01.... 4.6.24705.01     System.Linq.Expressions.dll

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Query

Post by Shalex » Fri 11 Aug 2017 16:47

We are investigating the question. We will notify you about the result.

Devart
Site Admin
Posts: 3974
Joined: Tue 26 Oct 2004 13:51

Re: EF Core Query

Post by Devart » Fri 08 Sep 2017 11:55

The bug with using the Retrieve Data functionality via Database Explorer and Model Explorer in EF Core Model is fixed (Microsoft.Data.SQLite): viewtopic.php?f=32&t=35928.

guinness
Posts: 25
Joined: Tue 22 Nov 2016 03:19

Re: EF Core Query

Post by guinness » Fri 08 Sep 2017 19:12

I upgraded to 6.1.333, but I still get the following error with Sqlite. Any ideas? Libraries being used are listed in post from Aug 3.

Code: Select all

The result of model generation or query syntax is not valid.
Failed to compile and load the working library with the model.
Error List:
error1 : The type 'System.Linq.IQueryable`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Linq.Expressions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
error2 : The type 'System.Linq.IQueryable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Linq.Expressions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

SecureGen
Devart Team
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Re: EF Core Query

Post by SecureGen » Tue 12 Sep 2017 13:27

Looks like the package Microsoft.EntityFrameworkCore.Sqlite you are using is too
old.
Please, try to use the newer version of Microsoft.EntityFrameworkCore.Sqlite. We recommend you to install the version 1.1.2:

Code: Select all

Install-Package Microsoft.EntityFrameworkCore.Sqlite -Version 1.1.2

guinness
Posts: 25
Joined: Tue 22 Nov 2016 03:19

Re: EF Core Query

Post by guinness » Tue 12 Sep 2017 20:37

@SecureGen I tried updating that, but same error. Below is my current list of libraries and versions that I'm using. Can you share yours?

Code: Select all

ProductVersion   FileVersion      FileName
--------------   -----------      --------
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Data.Sqlite.dll
1.1.2            1.1.2.30427      Microsoft.EntityFrameworkCore.dll
1.1.2            1.1.2.30427      Microsoft.EntityFrameworkCore.Relational.dll
1.1.2            1.1.2.30427      Microsoft.EntityFrameworkCore.Sqlite.dll
1.1.1            1.1.1.30217      Microsoft.Extensions.Caching.Abstractions.dll
1.1.1            1.1.1.30217      Microsoft.Extensions.Caching.Memory.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.DependencyInjection.Abstractions.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.DependencyInjection.dll
1.1.1            1.1.1.30217      Microsoft.Extensions.Logging.Abstractions.dll
1.1.1            1.1.1.30217      Microsoft.Extensions.Logging.dll
1.1.1            1.1.1.30217      Microsoft.Extensions.Options.dll
1.1.0-rtm-22752  1.1.0.21115      Microsoft.Extensions.Primitives.dll
2.1.1+Release... 2.1.1.30000      Remotion.Linq.dll
4.6.24705.01.... 4.6.24705.01     System.Collections.Immutable.dll
4.6.25220.01.... 4.6.25220.01     System.Diagnostics.DiagnosticSource.dll
3.0.0+Branch.... 3.0.0.0          System.Interactive.Async.dll

SecureGen
Devart Team
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Re: EF Core Query

Post by SecureGen » Fri 15 Sep 2017 07:46

We are investigating the question. We will notify you about the result.

guinness
Posts: 25
Joined: Tue 22 Nov 2016 03:19

Re: EF Core Query

Post by guinness » Fri 15 Sep 2017 23:13

Thanks for looking into this, I hope that you can reproduce. When I run NuGet command line as follows:

Code: Select all

nuget install Microsoft.EntityFrameworkCore.Sqlite -version 1.1.2 -o libs
It pulls in about 65 dependencies, one of which is version 4.3.0 of System.Linq.Expressions library. It's not clear to me where the dependency on version 4.0.10 is.

Which version of the SDK in C:\Program Files\dotnet\sdk would be used? Is there a way to specify?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: EF Core Query

Post by Pinturiccio » Wed 20 Sep 2017 13:29

We performed the following actions:
1. Created a console application (.NET Framework 4.6.1)
2. Installed the corresponding NuGet package by executing the following command in Package Manager Console:
Install-Package Microsoft.EntityFrameworkCore.Sqlite -version 1.1.2
3. Register the provider in app.config file:

Code: Select all

<configuration>
  <system.data>
    <DbProviderFactories>
      <add name="Microsoft.Data.SQLite" invariant="Microsoft.Data.SQLite" description="Microsoft.Data.Sqlite" type="Microsoft.Data.Sqlite.SqliteFactory, Microsoft.Data.Sqlite, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
  </system.data>
</configuration>
4. Created a model and executed Retrieve Data. There is no such error, the model is correctly compiled, and data selection starts correctly.

What should we change in these actions in order to reproduce the issue?

guinness
Posts: 25
Joined: Tue 22 Nov 2016 03:19

Re: EF Core Query

Post by guinness » Wed 20 Sep 2017 22:27

Thanks for your reply Pinturiccio. However what you are describing is integration within Visual Studio, whereas the issue I have is for standalone Entity Developer.

In addition, you are targeting the full framework rather than .NET Core. Try following the steps outlined in an earlier post by Shalex. I did try to create a .NET Core console application, but I get the following error:

Code: Select all

Could not load file or assembly 'Microsoft.EntityFrameworkCore' or one of its dependencies. The system cannot find the file specified.
As Shalex described in an earlier post you need to add the following to the project file, but how is this done with .NET Core projects?

Code: Select all

<EFCore core-assemblies-path="D:\PathToFolder\">

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF Core Query

Post by Shalex » Thu 28 Sep 2017 16:31

Pinturiccio wrote:We performed the following actions:
1. Created a console application (.NET Framework 4.6.1)
2. Installed the corresponding NuGet package by executing the following command in Package Manager Console:
Install-Package Microsoft.EntityFrameworkCore.Sqlite -version 1.1.2
3. Register the provider in app.config file:

Code: Select all

<configuration>
  <system.data>
    <DbProviderFactories>
      <add name="Microsoft.Data.SQLite" invariant="Microsoft.Data.SQLite" description="Microsoft.Data.Sqlite" type="Microsoft.Data.Sqlite.SqliteFactory, Microsoft.Data.Sqlite, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
  </system.data>
</configuration>
4. Created a model and executed Retrieve Data. There is no such error, the model is correctly compiled, and data selection starts correctly.
guinness, please follow steps specified by Pinturiccio to download Microsoft.EntityFrameworkCore.Sqlite.dll and related assemblies via nuget in the packages folder of your .NET Framework project. Then:
1) copy assemblies listed here from project's packages to the root of some folder (without subfolders), specify path to it in C:\Program Files (x86)\Common Files\Devart\EntityDeveloper\EntityDeveloper.exe.config:

Code: Select all

    <EFCore core-assemblies-path="D:\SomeFolder">
2) copy \packages\Microsoft.Data.Sqlite.1.1.0\lib\net451\Microsoft.Data.Sqlite.dll to C:\Program Files (x86)\Devart\EntityDeveloper\
3) copy \packages\SQLite.3.13.0\runtimes\win10-x64\nativeassets\uap10.0\sqlite3.dll to C:\Windows\SysWOW64\

Now Retrieve Data in a standalone Entity Developer should work. This is a list of assemblies loaded in the process of Entity Developer (via Visual Studio > Debug > Attach to Process): http://prntscr.com/gqu20b.

Post Reply