title: Using ConfigurationManager in Asp.net Core with .NET Framework website
body: <p>When you create an ASP.NET Core website you have the option of using .NET Core or .NET Framework, depending on (among other things) whether or not your site will use .NET Framework components.</p>
  
  <p>I need to reference a regular .NET Framework class library in my site, so I chose the .NET Framework option.</p>
  
  <p>However, this class library makes use of appSettings defined in the app.config file. Now, if I place an app.config file in my ASP.NET Core website, and create an appSettings section and populate it with the fields I need, everything works.</p>
  
  <p>However, these are sensitive keys (connection strings, etc.) so I want to be able to put them in an external file as described here: <a href="http://www.hanselman.com/blog/BestPracticesForPrivateConfigDataAndConnectionStringsInConfigurationInASPNETAndAzure.aspx" rel="nofollow noreferrer">http://www.hanselman.com/blog/BestPracticesForPrivateConfigDataAndConnectionStringsInConfigurationInASPNETAndAzure.aspx</a></p>
  
  <p>However, when I do this, I get an exception in the external library that the configuration setting is empty. I referenced the external file, which is in the same directory as the app.config in the root of the project (not the wwwroot folder) but the value always comes up empty. I tried putting the external config file in the wwwroot folder just out of desperation but that didn't work either.</p>
  
  <p>The external reference works fine in the .NET Framework project as well as a console app I used to test it;only the .NET Core website seems to be unable to be able to handle it as an external reference. It only works if it's inside the app.config file directly.</p>
  
  <p>Is pointing the configSource or file option for appSettings in app.config not supported in ASP.NET Core, or am I missing a step?</p>
  
  <p>If it can't be done, how can I pass the necessary configuration over to the external class library which was not built with .net core?</p>
  
  <p>EDIT:
  In summary: the class library is using System.Configuration, and NOT targeting .net core or standard. </p>
  
  <p>I'm using a website in ASP.NET core on .NET Framework, and my problem is that app.config works, but ONLY if the appSettings are in the app.config file. </p>
  
  <p>I want to move them to an external file (so the appSetting values are not checked into source) but this appears to not work.</p>
  
  <p>My problem isn't that configuration doesn't work, it's that I can't put their values in a separate file.</p>