-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for launchSettings.json to dotnet run #8274
Comments
@mlorbetske We need the parser for the file. Let me know when you have that. |
👀 |
The scope for now is to just set some environment variables before invoking the app. |
Passing the launchUrl wouldn't be too much work, right? We have a project with 4 simultaneously running processes that all talk to each other in one way or another. For VS studio users on Windows this all runs smoothly. For VS code on mac we've duplicated the settings to PS: VS for mac is terribly slow, so we're not using that. Running in there kinda worked, but at the cost of waiting over 3 minutes to start the project. |
A problem I ran into is that environment variables from launchSettings.json will always override env.vars set on command line, e.g. I have Maybe there should be a way to opt out of launchSettings? |
After running |
Sorry for bringing this up, but I noticed this comment: https://github.com/dotnet/cli/blob/master/src/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs#L18 |
We haven't talked about extending the support for launchSettings.json beyond what we already have. And we don't have plans to support 100% of it, as there are things there that don't make sense in the command line. |
Added note on Docs page to document this new default. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments EDIT: probably have a higher chance of success here: dotnet/AspNetCore.Docs#5023 |
thanks @geirsagberg, i was having the same problem with my app! |
So |
Is it true that the only thing left to honor is the |
Is the commandLineArgs still not supported ? |
I would need commandLineArgs as well, please implement it! |
+1 to support |
+1 as well |
+1 |
I can't believe .NET 5 is released and commandLineArgs is still not supported. |
As an alternative, you can set <PropertyGroup>
<StartArguments>--foo bar</StartArguments>
</PropertyGroup> |
@dasMulli Even better, set it in the user-specific project file (e.g. |
@livarcocc @DamianEdwards @sayedihashimi @mlorbetske @richlander lander
For ASP.NET Core projects we setup a bunch of useful machinery in our templates when running in Development. Unfortunately none of this machinery gets used when doing
dotnet new
anddotnet run
because the default environment is assumed to be Production and nothing specifies that the environment should be Development. The environment is typically specified using an environment variable (ASPNETCORE_ENVIRONMENT).VS today uses launchSettings.json to drive the F5 experience. This file enables you to specify things like environment variables when the application is launched. You can also specify additional command-line args, and whether the browser should be launched and at what address.
We'd like to add support to
dotnet run
for honoring the settings inlaunchSettings.json
. Initially we can limit this support to the "Project" command name and specifically add support for setting environement variables and command-line args. Later we can look adding support for things like specifying the application URL and launching the browser:@DustinCampbell We should also chat about having VSCode support this format
The text was updated successfully, but these errors were encountered: