title: What's the point of hosting.json since appsettings.json is sufficient
body: <p>In .NET Core 2 Web API app, I could override configuration <code>urls</code> using <code>appsettings.json</code>, but in the <a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/hosting?tabs=aspnetcore2x#overriding-configuration" rel="nofollow noreferrer">official docs</a> they introduced extra file "hosting.json", Why? What's the point of adding complexity?</p>
  
  <p>Below code is fully working using <code>appsettings.json</code>:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Program
  {
      public static void Main(string[] args)
      {
          BuildWebHost(args).Run();
      }
  
      public static IWebHost BuildWebHost(string[] args)
      {
          var config = new ConfigurationBuilder()
              .SetBasePath(Directory.GetCurrentDirectory()) //see Side note below
              .AddJsonFile("appsettings.json", optional: true)
              .AddCommandLine(args)
              .Build();
  
          return WebHost.CreateDefaultBuilder(args)
              .UseConfiguration(config)
              .UseStartup&lt;Startup&gt;()
              .Build();
      }
  }
  </code></pre>
  
  <p>appsettings.json content:
  </p>
  
  <pre><code>{
    "Logging": {
      "IncludeScopes": false,
      "Debug": {
        "LogLevel": {
          "Default": "Warning"
        }
      },
      "Console": {
        "LogLevel": {
          "Default": "Warning"
        }
      }
    },
    "urls": "http://*:5005/"
  }
  </code></pre>
  
  <p>Side note:
  Commenting <code>.SetBasePath(Directory.GetCurrentDirectory())</code> will keep VS 2017 debug mode operational (means apply <code>launchSettings.json</code>, and auto launch url) otherwise it won't. I guess its related to the <a href="https://github.com/aspnet/MetaPackages/blob/dev/src/Microsoft.AspNetCore/WebHost.cs#L152" rel="nofollow noreferrer">CreateDefaultBuilder</a> implementation.</p>