James Woodall:
When I deploy my Dot Net Core Web App to Azure, the Environment.ContentRootPath
variable is set to [myproject]/wwwroot
. However, in development, it is just [myproject]
.
Why does it change in Azure deployment?
How can I make it consistent?
For reference, this is my IWebHost
.
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((builderContext, config) =>
{
var env = builderContext.HostingEnvironment;
config.AddJsonFile("appsettings.json", false, true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", true, true);
if (env.IsDevelopment())
config.AddUserSecrets();
config.AddEnvironmentVariables();
})
.UseSetting("detailedErrors", "true")
.UseApplicationInsights()
.UseStartup()
.CaptureStartupErrors(true)
.Build();
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE