In vs.net I have multiple project in one solution, webApplication is startup project (asp.net core 2.1) and DataAccess project (Class library .net framework 4.6), I copied connection string from app.config (DataAccess project) to appsettings.json in webApplication but on access DB error ocurred: No connection string named 'Hemmat_Entities' could be found in the application config file.
app.config in DAL project:
<connectionStrings>
<add name="Hemmat_Entities" connectionString="metadata..."
</connectionStrings>
appsettings in asp.net core is:
{
"AllowedHosts": "*",
"ConnectionStrings": {
"Hemmat_Entities": "data source=.;initial
catalog=hemmat_new;integrated
security=True;multipleactiveresultsets=True;application
name=EntityFramework""
},
"Logging": {
"LogLevel": {
"Default": "Warning"
}
}
}