Where to get DNX_APPBASE after updating RC1?

I launched the asp.net 5 console application, which has been published in several environments for some time.

However, since the update is RC1, the environment variable is DNX_APPBASE, which I relied on for configuration. (environment), removed .json.

Here is the code in question Console application

Does anyone know what happened to the DNX_APPBASE environment variable and where can I get this information from?

Alternatively, what are other ways to achieve the same result?

+6
source share
1 answer

you can add this to 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 you don’t need to call .SetBasePath at all, so you can remove this.

+2
source

All Articles