.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

The specified initialization vector (IV) does not match the block size for this algorithm