Getting value from appsettings.json in .net core

Program and Startup class .NET Core 2.x You don’t need to new IConfiguration in the Startup constructor. Its implementation will be injected by the DI system. // Program.cs public class Program { public static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .Build(); } // Startup.cs public class Startup … Read more