title: ASP.NET 5 Config File not opening
body: <p>I've created a static class to use my configurations, but when I try to add the JSON file to the configuration I got an exception:</p>
  
  <p>MyConfigurations.json:</p>
  
  <pre><code>{ "ConnectionString": "my connection string", ...}
  </code></pre>
  
  <p>My static class constructor:</p>
  
  <pre><code>static MyConfigurations() {
      var configuration = new Configuration()
          .AddJsonFile("MyConfigurations.json")
          .AddEnvironmentVariables();
      ...
      ...
  </code></pre>
  
  <p>My exception occurs when the <code>.AddJsonFile</code> is executed.</p>
  
  <p>Exception: <code>Object reference not set to an instance of an object."</code></p>
  
  <p>StackTrace:</p>
  
  <blockquote>
    <p>at
    Microsoft.Framework.ConfigurationModel.PathResolver.get_ApplicationBaseDirectory()
    at
    Microsoft.Framework.ConfigurationModel.JsonConfigurationExtension.AddJsonFile(IConfigurationSourceRoot
    configuration, String path, Boolean optional) at
    Microsoft.Framework.ConfigurationModel.JsonConfigurationExtension.AddJsonFile(IConfigurationSourceRoot
    configuration, String path) at
    Project.SharedKernel.MyConfigurations..cctor() in
    C:\Project\Project.SharedKernel\MyConfigurations.cs:line 86</p>
  </blockquote>