.netcore json configuration using appsettings.json.
Nuget package required for configuration
- Microsoft.Extensions.Configuration (2.0.0)
- Microsoft.Extensions.Configuration.Json (2.0.0)
Code that is required in your main()
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json");
var configuration = builder.Build();
Comments