title: "InvalidOperationException: No service for type 'Microsoft.Extensions.Configuration.IConfiguration' has been registered."
body: <p>I'm somewhat of a newbie to programming, and very much a newbie to c# and .NET Core.</p>
  
  <p>I'm having some difficulty trying to ascertain why this simple "hello world" app is failing with the error in my title.  </p>
  
  <p>I'm trying to have the application read the "Hello!!" from appsettings.json and display it on the screen.</p>
  
  <p>Here is my Startup.cs</p>
  
  <pre><code>    using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.Http;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.Extensions.Logging;
  using Microsoft.Extensions.Configuration;
  
  namespace My_NET_Core_Test_2
  {
      public class Startup
      {
          // This method gets called by the runtime. Use this method to add services to the container.
          // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
          public void ConfigureServices(IServiceCollection services)
          {
          }
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, 
                                  IHostingEnvironment env, 
                                  ILoggerFactory loggerFactory,
                                  IConfiguration configuration)
          {
              loggerFactory.AddConsole();
  
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.Run(async (context) =&gt;
              {
                  var greeting = configuration["Greeting"];
                  await context.Response.WriteAsync(greeting);
              });
          }
      }
  }
  </code></pre>
  
  <p>Here is my Program.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.Hosting;
  
  namespace My_NET_Core_Test_2
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              var host = new WebHostBuilder()
                  .UseKestrel()
                  .UseContentRoot(Directory.GetCurrentDirectory())
                  .UseIISIntegration()
                  .UseStartup&lt;Startup&gt;()
                  .UseApplicationInsights()
                  .Build();
  
              host.Run();
          }
      }
  }
  </code></pre>
  
  <p>And here is my appsettings.json:</p>
  
  <pre><code>{
    "Greeting":  "Hello!!",
    "ConnectionStrings": {
      "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=_CHANGE_ME;Trusted_Connection=True;MultipleActiveResultSets=true"
    }
  }
  </code></pre>
  
  <p>I appreciate the assistance!</p>