-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No parameterless constructor was found on 'ClientsContext'. Either add a parameterless constructor to 'ClientsContext' or add an implementation of 'IDbContextFactory<ClientsContext>' in the same assembly as 'ClientsContext'. #8024
Comments
@pantonis Can you post the code of your DbContext class? |
|
@pantonis Also, calling Database.Migrate in your context constructor is likely to cause issues both because it is attempting to use the context before it is fully constructed, and because it will interfere with tooling which is also trying to do Migrations things at the same time. |
Dupe of #7264 |
For anyone out there having the same problem I managed to resolve it using an IDbContextFactory
The parameterized context constructor (code above) remained the same |
Describe what is not working as expected.
I am using a window service with Autofac DI and when I run
Add-Migration TestDD1InitialMigration
I get errorFurther technical details
EF Core version: 1.1.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017
The text was updated successfully, but these errors were encountered: