.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

Popular posts from this blog

A quick tutorial for OWASP ZAP tool for beginners

ionic2 cordova build android - Unable resolve gradle 2.2.3