run .net core application in development from the command line -
i know can configure settings in visual studio or visual studio code launch asp .net core application in development mode. i've had horrible experience build tools, , far running command line 1 working me.
the big problem have command line getting run in development mode. if understand, can done typing set aspnetcore_environment=development
before dotnet watch run
or setting system wide environment variables. there's gotta way, through file or something.
how can run in development mode command line, can include in package.json
of aurelia project?
you may use --environment
argument dotnet run
specify hosting environment:
dotnet run --environment "development"
but work after modify host building use configuration command line arguments config source.
- add dependency
microsoft.extensions.configuration.commandline
package add
main
method config creation based on arguments addingaddcommandline
extension methodconfigurationbuilder
:var config = new configurationbuilder() .addcommandline(args) .build();
use configuration adding
.useconfiguration(config)
step during host setup.var host = new webhostbuilder() .useconfiguration(config) .usekestrel() .usecontentroot(directory.getcurrentdirectory()) .useiisintegration() .usestartup<startup>() .build();
Comments
Post a Comment