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
I cannot seem to add migrations from third party lib's DbContexts (IdentityServer4.Entityframework). I'm getting error in title.
(My custom DbContext was found and I was able add migrations for it.)
Screenshots:
Firing dotnet ef command from DataAccess project path
Firing same command as above with startup project specified
So from issue #5320 I have to specify the startup project to execute migration commands and then it doesn't find the other two DbContexts.
I'm probably missing something but, I have no idea what.
Update
From the author's site in an earlier article on EF Core migrations he noted this error:
"No parameterless constructor was found on 'TContext'. Either add a parameterless constructor to 'TContext' or add an implementation of 'IDbContextFactory' in the same assembly as 'TContext'." (emphasis mine).
That could maybe explain why it's not picking up the other DbContexts. Just not sure why it picks them up when running dotnet ef command from DataAccess project path.
Update 2
After chatting with @bjcull I've come to the conclusion that the issue I'm having is most likely with Npgsql.EntityFrameworkCore so will open an issue there (seeing as I can add the migrations when using SqlServer).
Seeing as I could add the one migration using the dotnet ef startup project option I guess I'm just missing a library in my .NET Standard class library.
The text was updated successfully, but these errors were encountered:
I cannot seem to add migrations from third party lib's DbContexts (IdentityServer4.Entityframework). I'm getting error in title.
(My custom DbContext was found and I was able add migrations for it.)
Steps to reproduce
I followed this short tutorial's 'Starting from scratch...' section: http://benjii.me/2017/05/enable-entity-framework-core-migrations-visual-studio-2017/ with the only difference being that I'm trying to use efcore for pgsql .
Repro project: https://github.com/qvsmith/migration-issue-repro
Screenshots:
Firing dotnet ef command from DataAccess project path
Firing same command as above with startup project specified
So from issue #5320 I have to specify the startup project to execute migration commands and then it doesn't find the other two DbContexts.
I'm probably missing something but, I have no idea what.
Update
From the author's site in an earlier article on EF Core migrations he noted this error:
"No parameterless constructor was found on 'TContext'. Either add a parameterless constructor to 'TContext' or add an implementation of 'IDbContextFactory' in the same assembly as 'TContext'." (emphasis mine).
That could maybe explain why it's not picking up the other DbContexts. Just not sure why it picks them up when running dotnet ef command from DataAccess project path.
Update 2
After chatting with @bjcull I've come to the conclusion that the issue I'm having is most likely with Npgsql.EntityFrameworkCore so will open an issue there (seeing as I can add the migrations when using SqlServer).
Seeing as I could add the one migration using the dotnet ef startup project option I guess I'm just missing a library in my .NET Standard class library.
The text was updated successfully, but these errors were encountered: