Answers for "hostbuilder add environment variables"

C
0

hostbuilder add environment variables

var builder = new HostBuilder();
        builder
        .ConfigureHostConfiguration(config =>
         {
             config.AddEnvironmentVariables(prefix:"DOTNETCORE_");
         })
         .ConfigureAppConfiguration((context, config) =>
         {
             config.AddJsonFile("appsettings.json", optional: false);
             config.AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", optional: true);
         })
Posted by: Guest on June-09-2020

Code answers related to "hostbuilder add environment variables"

Code answers related to "C"

Browse Popular Code Answers by Language