With AspNet Core, I would like to have a different config value when I develop a web site on my local computer and when the web site is published on the development server.
For exemple, on my computer, the log files use the path "..\..\logs\app.log"
and on the development server it's "w:\logs\app.log"
. Since that by default, AspNet Core is using the appsettings.Development.json file wherever I'm on my development computer or on the development server, I cannot set the path differently.
So how can I distinguish when the code run on my local computer and when it run on my development server and have a different settings in my appsettings.json files and still use env.IsDevelopment()
that will return true
on both environment? The reason I need that is because Microsoft use the IsDevelopment()
function in there own logic and I don't want to break that.