Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger (1 reply)

$
0
0
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'.

Viewing all articles
Browse latest Browse all 1447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>