Using optional configuration for IIS deployment
This commit is contained in:
parent
a3b1954810
commit
2f36a9cd6b
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNet.Authentication.Facebook;
|
||||
using Microsoft.AspNet.Authentication.Google;
|
||||
using Microsoft.AspNet.Authentication.MicrosoftAccount;
|
||||
|
|
@ -32,13 +31,8 @@ namespace MusicStore
|
|||
//then the later source will win. By this way a Local config can be overridden by a different setting while deployed remotely.
|
||||
Configuration = new Configuration()
|
||||
.AddJsonFile("config.json")
|
||||
.AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values.
|
||||
|
||||
// Used to override some configuration parameters that cannot be overridden by environment.
|
||||
if (File.Exists(Path.Combine(appEnvironment.ApplicationBasePath, "configoverride.json")))
|
||||
{
|
||||
((Configuration)Configuration).AddJsonFile("configoverride.json");
|
||||
}
|
||||
.AddEnvironmentVariables() //All environment variables in the process's context flow in as configuration values.
|
||||
.AddJsonFile("configoverride.json", optional: true); // Used to override some configuration parameters that cannot be overridden by environment.
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; private set; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue