Been running a asp.net 5 console application that is published to multiple environments for a while now.
However, since the RC1 update, the environmental variable DNX_APPBASE that I relied on for the config.(environment).json location has been removed.
Here is the code in question
Anyone know what happened to the DNX_APPBASE environmental variable and where I can get this information from?
Alternatively, what are other ways to achieve the same result?
you could add this into the constructor for Startup.cs
using Microsoft.Extensions.PlatformAbstractions;
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
{
// Setup configuration sources.
var builder = new ConfigurationBuilder()
.SetBasePath(appEnv.ApplicationBasePath)
....
}
but in RC1 it is not needed to call .SetBasePath at all, so you could remove that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With