title: How to SetBasePath in ConfigurationBuilder in Core 2.0
body: <p>How can I set the base path in ConfigurationBuilder in Core 2.0. </p>
  
  <p>I have googled and found <a href="https://stackoverflow.com/questions/33169589/specify-the-application-base-path-in-configurationbuilder-in-beta8">this</a> question, <a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration?tabs=basicconfiguration" rel="noreferrer">this</a> from Microsoft docs, and the <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.fileconfigurationextensions.setbasepath?view=aspnetcore-2.0#Microsoft_Extensions_Configuration_FileConfigurationExtensions_SetBasePath_Microsoft_Extensions_Configuration_IConfigurationBuilder_System_String_" rel="noreferrer">2.0</a> docs online but they seem to be using a version of <code>Microsoft.Extension.Configuration</code> from <a href="https://github.com/aspnet/Configuration/blob/1.0.0-beta8/src/Microsoft.Framework.Configuration.FileExtensions/FileConfigurationExtensions.cs" rel="noreferrer">1.0.0-beta8</a>.</p>
  
  <p>I want to read <code>appsettings.json</code>. Is there a new way of doing this in Core 2.0?</p>
  
  <pre><code>using System;
  using System.IO;
  using Microsoft.Extensions.Configuration;
  namespace ConsoleApp2
  {
      class Program
      {
          public static IConfigurationRoot Configuration { get; set; }
  
          static void Main(string[] args)
          {
              var builder = new ConfigurationBuilder()
                  .SetBasePath(Directory.GetCurrentDirectory()) // &lt;== compile failing here
                  .AddJsonFile("appsettings.json");
  
              Configuration = builder.Build();
  
              Console.WriteLine(Configuration.GetConnectionString("con"));
              Console.WriteLine("Press a key...");
              Console.ReadKey();
          }
      }
  }
  </code></pre>
  
  <p><strong>appsetting.json</strong></p>
  
  <pre><code>{
    "ConnectionStrings": {
      "con": "connection string"
    }
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  In addition to adding <a href="https://www.nuget.org/packages/Microsoft.Extensions.Configuration.FileExtensions/" rel="noreferrer">Microsoft.Extensions.Configuration.FileExtensions</a> as indicated below by <a href="https://stackoverflow.com/users/2833802/set">Set</a> I also needed to add <a href="https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Json/" rel="noreferrer">Microsoft.Extensions.Configuration.Json</a> to get the <code>AddJsonFile</code> extension.</p>