I am developing an ASP.NET 5 Web API app using Visual Studio code on Mac. I manually modified my Properties/launchSettings.json
file to set environment to Sta
Adding to @Chrysalis answer, you could also avoid "messing" with current environment by passing needed variables on command line.
Inside project.json
file, say that you have a web-dev
command specific for development environment:
"commands": {
"web-dev": "Microsoft.AspNet.Server.Kestrel
--ASPNET_ENV Development --Hosting:Environment Development
--config hosting.Development.json",
},
where you can see how both ASPNET_ENV
, Hosting:Environment
are set, as well as invoking a specific hosting.json
configuration.
NOTE: command is split on several lines just for readability, join again before actually pasting in JSON file.