title: Getting Null Exception for Entity Framework core 1.1
body: <p>I am getting null exception for configure Service. I am using Entity Framework 1.1, previously use core 1.0 and have no issue, not sure what I am missing here </p>
  
  <h2>Error In Startup.cs --> at Services.AddDbContext...</h2>
  
  <pre><code> {System.ArgumentNullException: Value cannot be null.
   Parameter name: connectionString
   at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)
  at   Microsoft.EntityFrameworkCore.SqlServerDbContextOptionsExtensions.UseSqlServer(D bContextOptionsBuilder optionsBuilder, String connectionString, Action`1 sqlServerOptionsAction)
  at App.WebDashboard.Startup.&lt;ConfigureServices&gt;b__4_0(DbContextOptionsBuilder options)
  at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.DbContextOptionsFactory[TContext](IServiceProvider applicationServiceProvider, Action`2 optionsAction)
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
  at  Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
  at Microsoft.Extensions.DependencyInjection.ServiceProvider.&lt;&gt;c__DisplayClass16_0.&lt;RealizeService&gt;b__0(ServiceProvider provider)
  at Microsoft.Extensions.Internal.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)
  at lambda_method(Closure , IServiceProvider , Object[] )
  at Microsoft.AspNetCore.Mvc.Internal.TypeActivatorCache.CreateInstance[TInstance](IServiceProvider serviceProvider, Type implementationType)
  at Microsoft.AspNetCore.Mvc.Controllers.DefaultControllerFactory.CreateController(ControllerContext context)
  at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State&amp; next, Scope&amp; scope, Object&amp; state, Boolean&amp; isCompleted)
  at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker. &lt;InvokeNextResourceFilter&gt;d__22.MoveNext()}
  </code></pre>
  
  <h2>Startup.cs</h2>
  
  <pre><code> public void ConfigureServices(IServiceCollection services)
      {
          // Add framework services.
          services.AddApplicationInsightsTelemetry(Configuration);
  
          services.AddDbContext&lt;TestDbContext&gt;(options =&gt;
             options.UseSqlServer(Configuration.GetConnectionString("UCASAppDatabase")));
  
          services.AddMvc();
      }
  </code></pre>
  
  <h2> Connection string in appsetting.json</h2>
  
  <pre><code>"ConnectionStrings": {
    "UCASAppDatabase": "Data Source=mydatasource;Initial Catalog=UCAS-DB;Integrated Security=True"
  }
  </code></pre>
  
  <h2>DbContext</h2>
  
  <pre><code> public class TestDbContext : DbContext
   {
      public TestDbContext(DbContextOptions&lt;TestDbContext&gt; options) : base(options)
      { }
  
      public DbSet&lt;TestModel&gt; TestModels { get; set; }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          modelBuilder.Entity&lt;TestModel&gt;().ToTable("TestTable");
      }
  }
  </code></pre>
  
  <h2>Entity Class</h2>
  
  <pre><code>[Table("TestTable")]
  public class TestModel
  {
      [Key]
      public int ID { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <h2>Controller class where I am trying to read data</h2>
  
  <pre><code>public class HomeController : Controller
  {
      private readonly TestDbContext _context;
      public HomeController(TestDbContext context)
      {
          this._context = context;
      }
  
      public IActionResult About()
      {
          var query = (from b in _context.TestModels
                       select b).ToList();
  
          ViewData["Message"] = "Your application description page.";
  
          return View();
      }
  </code></pre>
  
  <h2>Appsettings.json</h2>
  
  <pre><code> public Startup(IHostingEnvironment env)
      {
          var builder = new ConfigurationBuilder()
              .SetBasePath(env.ContentRootPath)
              .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
              .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
              .AddEnvironmentVariables();
  </code></pre>