Comments (3)
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.
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.
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)
- [Single case DUs] The binary operator Equal is not defined for the types `UserId` and `UserId` HOT 1
- DbContextHelpers.fs methods return type obj instead of 'a HOT 1
- [Option] Optional DateTime properties cannot be filtered HOT 1
- Migration not generated due to optional single case DU HOT 1
- Unable to create migration using Pomelo's connector when Option types are already present in model HOT 7
- How do you create an optional navigation property? HOT 3
- Scaffolding fails if a column uses a DEFAULT value
- singleCaseUnionMemberTranslator Translate should return null for non-applicable expressions
- Support for empty discriminated union HOT 2
- Documentation: Guide on how to create a many-to-many relationships HOT 2
- When trying to call registerSingleCaseUnionTypes from C#, I get an InvalidOperationException
- NullReferenceException on second migration HOT 1
- NullReferenceException when deleting optional fields
- Support EF Core 7 HOT 1
- Scaffolding a `nvarchar NULL` creates a `string` and not a `string option`
- Nullpointer on second migration when having a string option field
- Extension UseFsharpTypes() interferes with the npgsql translation for where statement on jsonb columns
- Subsequent migrations fail with `type 'JsonDocument' is not defined` error for JSONB column HOT 3
- Npgsql JSONB to POCO mapping produces an empty `open` stmt in `Migration/*Snapshot.fs`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from efcore.fsharp.