title: Published .Net Core 2 application does not read appsettings.json file
body: <p>I have 2 apps, one console one web api both .net core v2.0 . Both has the same problem.</p>
  
  <p>I used to run my application thru source files. I was building and running them on a linux machine. Everything was good, everything was great, but now i'm running the same app thru publish output.</p>
  
  <p>Now it doesn't work as it suppose to, because the app can't read appsettings.json.</p>
  
  <pre><code>configuration["Settings:Port"] != null 
  ? int.Parse(configuration["Settings:Port"]) //i should be getting this - 1234
  : default(int) //but instead i got this - 0
  </code></pre>
  
  <p>I have corrupted the appsettings.json file and i was expecting to see an exception but, nothing. Just nothing. I checked the file a couple of times, i modified the file a couple of times just because i was desperate. Nothing. Nothing happens, nothing changes.</p>
  
  <p>I tried debug-build, i tried release-build, i tried to change build action of that file... I tried this, i tried that... Nothing works and i have no idea why.</p>
  
  <p>And as you can guess, i need a few advices. Thank you all.</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <p>How i use/read config file:</p>
  
  <pre><code>IConfiguration configuration = new ConfigurationBuilder()
  .SetBasePath(Directory.GetCurrentDirectory())
  .AddJsonFile("appsettings.json", true, true).Build();
  </code></pre>