Using latest EF.
Packages:
<PackageReference Include="EFCore.NamingConventions" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
When I run
dotnet ef migrations add Initial --project=App.Console
I get the following error
An error occurred while accessing the Microsoft.Extensions.Hosting
services. Continuing without the application service provider. Error:
Some services are not able to be constructed (Error while validating
the service descriptor ‘ServiceType: App.Game.Players.PlayerLogic
Lifetime: Transient ImplementationType: App.Game.Players.PlayerLogic’:
Unable to resolve service for type ‘System.Int32’ while attempting to
activate ‘App.Game.Players.PlayerLogic’.) (Error while validating the
service descriptor ‘ServiceType: App.Networking.Client.INetworkClient
Lifetime: Transient ImplementationType:
App.Networking.Client.NetworkClient’: Unable to resolve service for
type ‘DotNetty.Transport.Channels.IChannel’ while attempting to
activate ‘App.Networking.Client.NetworkClient’.) (Error while
validating the service descriptor ‘ServiceType:
App.Networking.Client.INetworkClient Lifetime: Transient
ImplementationType: App.Networking.Client.NetworkClient’: Unable to
resolve service for type ‘DotNetty.Transport.Channels.IChannel’ while
attempting to activate ‘App.Networking.Client.NetworkClient’.)
I then get underneath it
No DbContext was found in assembly 'App.Console'. Ensure that you're using the correct assembly and that the type is neither abstract nor generic.
This is because my DbContext is in App.Database, but my service hosting is in App.Console.
2