I'm trying to add .NET 4.6.1 class library project which using Entity-Framework 6 as DAL layer into a solution which is running under .Net Core 2.2 startup project (Web-Api). The EF project was using a different "old" (.NET Framework 4.6.1 class library) web-api project as end points, but now I want to gather all the end-points under one project.
The problem is that the running context is .NET Core 2.2 which use appsettings.json as configuration file, so I copied the ConnectionsStrings details from the "old" XML configuration into the appsettings.json file, but it seems like the EF can't read connection strings (which used to be in a web.config XML file when used the "old" .net 4.2 web-api project) from the appsettings.json file.
- I'd rather continue working with the current EF and not change it to EF .Core
The error I'm getting is: "No connection string named '' could be found in the application config file"
How can I solve it ?
Is there a reason for .Net core not "naturally" working with EF 6 when on .NET 4.6 ?
This is my appsettings.json file (Ignore types - it is not copy-paste but free hand copying):
"ConnectionStrings":
{
"MyMainDBEntities": {
"ConnectionString": "metadata=res:...",
"providerName": "system.Data.EntityClient"
}
}
it seems like there is no real option other that using the EF Core - this is how I fixed the problem