Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogge r
I tried to scaffold a database like the example.
I have a Console project, .NET 6.0
Installed MySQL.EntityFrameworkCore 6.0.4
Installed Microsoft.EntitiFrameworkCore.Tools 6.0.4
When trying
Scaffold-DbContext "Server=localhost;Database=mydatabase;Uid=root;Pwd=root" MySql.EntityFrameworkCore -OutputDir tmp -f it gives an error. Tried different versions of .NET nothing liked to work.
The error:
Build started...
Build succeeded.
System.InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger`1[Microsoft.EntityFrameworkCore.DbLoggerCategory+Scaffolding]' while attempting to activate 'MySql.EntityFrameworkCore.Scaffolding.Internal.MySQLDatabaseModelFactory'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteF
...
...
...
Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger`1[Microsoft.EntityFrameworkCore.DbLoggerCategory+Scaffolding]' while attempting to activate 'MySql.EntityFrameworkCore.Scaffolding.Internal.MySQLDatabaseModelFactory'.
Subject
Written By
Posted
Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogge r
December 12, 2022 04:24AM
December 16, 2022 09:33AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.