How to get settings from appsettings.json in a referenced .NET Framework project
<p>I've got a DAL with EntityFramework 6 running in .NET Framework 4.6.1 as a project. Works fine in solutions with other .NET Framework projects. Now am I going to use same DAL project referenced to my ASP.NET Core WebApi (using .NET Framework 4.6.1) and it doesn't work. The exception says:</p>

<blockquote>
  <p>No connection string named 'MyEntities' could be found in the application config file.</p>
</blockquote>

<p>.NET Core project does not hava a web.config file, so EF6 How can I pass settings from appsettings.json in my Core project to the referenced DAL project?</p>

<p>I've found some examples to get EF6 working inside .NET Core projects (like <a href="https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6</a>), but it doesn't help me. I guess that's becouse the dbcontext is created inside the DAL project.</p>

<p>appsettings.json</p>

<pre><code>"ConnectionStrings": {
  "MyEntities": "&lt;my connectionString&gt;"
},
</code></pre>

<p>project.json</p>

<pre><code>"dependencies": {
  "EntityFramework": "6.1.3",
  ...
},
...
"frameworks": {
  "net461": {
    "dependencies": {
      "DAL": {
        "target": "project"
      }
    },
    "imports": "dnxcore50"
  } 
},
</code></pre>