GithubHelp home page GithubHelp logo

Comments (3)

teves-castro avatar teves-castro commented on June 15, 2024 2

Also trying to test this int a net7.0 project without success.
As far as I understand this library was compiled with a reference to Microsoft.EntityFrameworkCore.Design 6.0 which seems to not be compatible with Entity Framework 7.

from efcore.fsharp.

Yury-Zakharov avatar Yury-Zakharov commented on June 15, 2024 1

What I have found recently:
The error described has nothing to do with dotnet-ef tool installed - it fails equally with version 7 and 6.
It also has nothing to do (directly) with your project target version, fails both with .net7 and .net6
What really matters is the version of Microsoft.EntityFrameworkCore nuget package used in your project.
I downgraded mine to 6.0.13 and the command 'dotnet ef migrations add' works like a charm.
I have not changed the version of EFCore.FSharp though, as it's built with EntityFrameworkCore v6.0
As a workaround this downgrade works, in theory you can downgrade, add migrations and upgrade again but this way is a bit risky to me, there are some breaking changes in EF Core since 6.0 and one day they'll bite me.

Further investigation shows that one of the breaking changes in EF Core is in 'ICSharpHelper' , namely 'ICSharpHelper.Fragment'. ave not looked deeper, whether it's changed or removed or moved somewhere else, not sure.

Would be nice to see the fix in EFCore.FSharp soon. I could help within my humble knowledge, but, realistically, not much :)

from efcore.fsharp.

EspenBrun avatar EspenBrun commented on June 15, 2024

I also had this problem, and manually editing the paket.lock file to target 6.0.13 for Microsoft.EntityFrameworkCore and other dependencies that where targeting 7.0.9 on my machine. Just did a search an replace. My paket.lock diff after changes:

diff --git a/paket.lock b/paket.lock
index 870c228..3b86826 100644
--- a/paket.lock
+++ b/paket.lock
@@ -5,30 +5,30 @@ NUGET
       Microsoft.EntityFrameworkCore.Design (>= 6.0) - restriction: >= net6.0
     FSharp.Core (6.0.7)
     Humanizer.Core (2.14.1) - restriction: >= net6.0
-    Microsoft.Data.Sqlite.Core (7.0.9) - restriction: >= net6.0
+    Microsoft.Data.Sqlite.Core (6.0.13) - restriction: >= net6.0
       SQLitePCLRaw.core (>= 2.1.4) - restriction: >= netstandard2.0
-    Microsoft.EntityFrameworkCore (7.0.9) - restriction: >= net6.0
-      Microsoft.EntityFrameworkCore.Abstractions (>= 7.0.9) - restriction: >= net6.0
-      Microsoft.EntityFrameworkCore.Analyzers (>= 7.0.9) - restriction: >= net6.0
+    Microsoft.EntityFrameworkCore (6.0.13) - restriction: >= net6.0
+      Microsoft.EntityFrameworkCore.Abstractions (>= 6.0.13) - restriction: >= net6.0
+      Microsoft.EntityFrameworkCore.Analyzers (>= 6.0.13) - restriction: >= net6.0
       Microsoft.Extensions.Caching.Memory (>= 7.0) - restriction: >= net6.0
       Microsoft.Extensions.DependencyInjection (>= 7.0) - restriction: >= net6.0
       Microsoft.Extensions.Logging (>= 7.0) - restriction: >= net6.0
-    Microsoft.EntityFrameworkCore.Abstractions (7.0.9) - restriction: >= net6.0
-    Microsoft.EntityFrameworkCore.Analyzers (7.0.9) - restriction: >= net6.0
-    Microsoft.EntityFrameworkCore.Design (7.0.9) - restriction: >= net6.0
+    Microsoft.EntityFrameworkCore.Abstractions (6.0.13) - restriction: >= net6.0
+    Microsoft.EntityFrameworkCore.Analyzers (6.0.13) - restriction: >= net6.0
+    Microsoft.EntityFrameworkCore.Design (6.0.13) - restriction: >= net6.0
       Humanizer.Core (>= 2.14.1) - restriction: >= net6.0
-      Microsoft.EntityFrameworkCore.Relational (>= 7.0.9) - restriction: >= net6.0
+      Microsoft.EntityFrameworkCore.Relational (>= 6.0.13) - restriction: >= net6.0
       Microsoft.Extensions.DependencyModel (>= 7.0) - restriction: >= net6.0
       Mono.TextTemplating (>= 2.2.1) - restriction: >= net6.0
-    Microsoft.EntityFrameworkCore.Relational (7.0.9) - restriction: >= net6.0
-      Microsoft.EntityFrameworkCore (>= 7.0.9) - restriction: >= net6.0
+    Microsoft.EntityFrameworkCore.Relational (6.0.13) - restriction: >= net6.0
+      Microsoft.EntityFrameworkCore (>= 6.0.13) - restriction: >= net6.0
       Microsoft.Extensions.Configuration.Abstractions (>= 7.0) - restriction: >= net6.0
     Microsoft.EntityFrameworkCore.Sqlite (6.0.20)
       Microsoft.EntityFrameworkCore.Sqlite.Core (>= 6.0.20) - restriction: >= net6.0
       SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.2) - restriction: >= net6.0
-    Microsoft.EntityFrameworkCore.Sqlite.Core (7.0.9) - restriction: >= net6.0
-      Microsoft.Data.Sqlite.Core (>= 7.0.9) - restriction: >= net6.0
-      Microsoft.EntityFrameworkCore.Relational (>= 7.0.9) - restriction: >= net6.0
+    Microsoft.EntityFrameworkCore.Sqlite.Core (6.0.13) - restriction: >= net6.0
+      Microsoft.Data.Sqlite.Core (>= 6.0.13) - restriction: >= net6.0
+      Microsoft.EntityFrameworkCore.Relational (>= 6.0.13) - restriction: >= net6.0
       Microsoft.Extensions.DependencyModel (>= 7.0) - restriction: >= net6.0
     Microsoft.Extensions.Caching.Abstractions (7.0) - restriction: >= net6.0
       Microsoft.Extensions.Primitives (>= 7.0) - restriction: || (>= net462) (>= netstandard2.0)

from efcore.fsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.