2
votes

I have a solution with multiple projects one of them with EF 6 and another one with entityframeworkcore.

The migrations were working fine before adding EF6 project, but now I can't use the migration's command : add-migration 'anything'

Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework Core tools are running. Use 'EntityFramework\Add-Migration' for Entity Framework 6.

For the project with EF6 I can add a migration using this way: EntityFramework\Add-Migration 'anthing_here', but I can't add a migrations to the project with EFCore using this way.

Any suggestions ??

1
EntityFrameworkCore\Add-Migration anything? - Ivan Stoev
You can try with dotnet core cli tools . You should be able to run migrations from external command window by pointing to project folder... - Nish26
you could try dotnet ef add-migration if you get an error saying dotnet-ef isn't a command, then you're missing the tooling from your .CSPROJ file. - Adam Vincent
@AdamVincent I had exactly the same error 'dotnet-ef isn't a command' , but adding tools its throwing error : ''DotnetCliTool' is not supported by project' . - Shahrukh Ahmad
are you targeting a .net core app? You can use EF 6 in a .NET Core App, but you can't use EF Core in a .NET Framework app afaik - Adam Vincent

1 Answers

6
votes

For EF6:

EntityFramework\Add-Migration <MIGRATIONNAME>

For EF Core:

EntityFrameworkCore\Add-Migration <MIGRATIONNAME>