question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatibility with net6 project + EFCore 7

See original GitHub issue

I wonder why packages for EF7 are bound to net7 in Elsa since its quite legit to use EF7 with net6. With the configuration net6+EF7, Elsa throws a MethodNotFound exception when trying to apply migrations.

System.MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder`1<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder.CreateIndex(System.String, System.String, System.String, System.String, Boolean, System.String)'.
   at Elsa.Persistence.EntityFramework.SqlServer.Migrations.Initial.Up(MigrationBuilder migrationBuilder)
   at Microsoft.EntityFrameworkCore.Migrations.Migration.BuildOperations(Action`1 buildAction)
   at Microsoft.EntityFrameworkCore.Migrations.Migration.get_UpOperations()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass16_2.<GetMigrationCommandLists>b__2()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
   at Elsa.Persistence.EntityFramework.Core.StartupTasks.RunMigrations.ExecuteAsync(CancellationToken cancellationToken)
   at Elsa.Persistence.EntityFramework.Core.StartupTasks.RunMigrations.ExecuteAsync(CancellationToken cancellationToken)
   at Elsa.Runtime.StartupRunner.StartupAsync(CancellationToken cancellationToken)
   at Elsa.Runtime.StartupRunner.StartupAsync(CancellationToken cancellationToken)
   at Elsa.HostedServices.StartupRunnerHostedService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)

Issue Analytics

  • State:open
  • Created 6 months ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sfmskywalkercommented, Mar 20, 2023

I like it, I think we should do it. @mohdali is gonna give it a go. Thanks for the suggestions!

0reactions
montoner0commented, Mar 10, 2023

I’d rather avoid use of EF and NET in sync since net6 is LTS and net7 is not.

Probably, it could be nice to extract the migrations into a separate package, so people could use the one they need or even allow devs to include the migrations inside their own app as it’s done in https://github.com/appany/AppAny.Quartz.EntityFrameworkCore.Migrations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Package Microsoft.EntityFramework.Core 6.0.0 is not ...
my problem was that I use net 5 and it tried to install the latest version of entity framework so the solution was...
Read more >
Migrate from ASP.NET Core 6.0 to 7.0
NET 7 version of the .NET WebAssembly build tools are incompatible with existing projects built with .NET 6. Projects using the .NET WebAssembly ......
Read more >
Microsoft Details Entity Framework Core 7 Plan, EF6 to EF ...
NET, unveiling a plan for Entity Framework Core 7, ... NET Framework-compatible EF versions, actually supporting EF Core as well as .
Read more >
EF Core 6.0.0 Preview-6 no longer compatible with .NET 5.
File a bug Trying to update the EF Core packages to Preview-6 results in the following: Checking compatibility for Microsoft.
Read more >
XAF and .NET / EF Core supported versions
Hi,. This new .NET versions have me all confused (especially compatibility between them), so sorry if I am asking dumb questions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found