You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after upgrading to EFCore 6 adding new migration doesn't work as before (and as intended) because adding new migration tries to start the project instead of using IDesignTimeDbContextFactory which results in an infinite loop since our project tries to repeatedly contact several endpoints that are unreachable from development computers. There is only one DbContext in the project and only one IDesignTimeDbContextFactory implementation.
Basically currently we are unable to create new migrations. Everything worked fine on EFCore 2 and EFCore 5 but not anymore on EFCore 6. Could you point us where the problem might be?
EntityFrameworkCore\Add-Migration TestMigration -Verbose
Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework Core tools are running. Use 'EntityFramework6\Add-Migration' for Entity Framework 6.
Using project 'Inquiry\MyProject'.
Using startup project 'Inquiry\MyProject'.
Build started...
Build succeeded.
C:\Program Files\dotnet\dotnet.exe exec --depsfile C:\Repos\MyProject\bin\Debug\net6.0\MyProject.deps.json --additionalprobingpath C:\Users\dflorek\.nuget\packages --additionalprobingpath "C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages" --additionalprobingpath "C:\Program Files\dotnet\sdk\NuGetFallbackFolder" --runtimeconfig C:\Repos\MyProject\bin\Debug\net6.0\MyProject.runtimeconfig.json C:\Users\dflorek\.nuget\packages\microsoft.entityframeworkcore.tools\6.0.0\tools\netcoreapp2.0\any\ef.dll migrations add TestMigration --json --verbose --no-color --prefix-output --assembly C:\Repos\MyProject\bin\Debug\net6.0\MyProject.dll --project C:\Repos\MyProject\MyProject.csproj --startup-assembly C:\Repos\MyProject\bin\Debug\net6.0\MyProject.dll --startup-project C:\Repos\MyProject\MyProject.csproj --project-dir C:\Repos\MyProject\ --language C# --configuration Debug --working-dir C:\Repos\ --root-namespace MyProject
Using assembly 'MyProject'.
Using startup assembly 'MyProject'.
Using application base 'C:\Repos\MyProject\bin\Debug\net6.0'.
Using working directory 'C:\Repos\MyProject'.
Using root namespace 'MyProject'.
Using project directory 'C:\Repos\MyProject\'.
Remaining arguments: .
The Entity Framework tools version '6.0.0' is older than that of the runtime '6.0.1'. Update the tools for the latest features and bug fixes. See https://aka.ms/AAc1fbw for more information.
Finding DbContext classes...
Finding IDesignTimeDbContextFactory implementations...
Found IDesignTimeDbContextFactory implementation 'MyDbContextFactory'.
Found DbContext 'MyDbContext'.
Finding application service provider in assembly 'MyProject'...
Finding Microsoft.Extensions.Hosting service provider...
Using environment 'localhost'.
///OUR APP LOGGING
...
EF Core version: 6.0.1
Database provider: Microsoft.EntityFrameworkCore.Sqlite
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022 v17.0.5
The text was updated successfully, but these errors were encountered:
Hi,
after upgrading to EFCore 6 adding new migration doesn't work as before (and as intended) because adding new migration tries to start the project instead of using IDesignTimeDbContextFactory which results in an infinite loop since our project tries to repeatedly contact several endpoints that are unreachable from development computers. There is only one DbContext in the project and only one IDesignTimeDbContextFactory implementation.
Basically currently we are unable to create new migrations. Everything worked fine on EFCore 2 and EFCore 5 but not anymore on EFCore 6. Could you point us where the problem might be?
IDesignTimeDbContextFactory implementation:
Verbose output of adding migration:
EF Core version: 6.0.1
Database provider: Microsoft.EntityFrameworkCore.Sqlite
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022 v17.0.5
The text was updated successfully, but these errors were encountered: