Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created February 23, 2021 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/d31893dc7df45e50d1b02b600f70d914 to your computer and use it in GitHub Desktop.
Save xximjasonxx/d31893dc7df45e50d1b02b600f70d914 to your computer and use it in GitHub Desktop.
Host.CreateDefaultBuilder()
.ConfigureAppConfiguration((_, builder) =>
builder.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false)
.AddJsonFile($"appsettings.{System.Environment.GetEnvironmentVariable("ENV")}.json", optional: true)
.Build())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment