C
C#2y ago
Messiah

❔ dotnet start, and profiles

When I run dotnet run, which profile from launchSettings.json is chosen? There are so many ways to set profiles in .net, I'm confused.
4 Replies
Messiah
MessiahOP2y ago
like, what's the point of settings up kestrel endpoints if I'm gonna set up the application urls afterwards anyways? the docs are awful at explaining this
lycian
lycian2y ago
Best practice would be to specify with --launch-profile otherwise it chooses the first it finds that qualifies as "default" from this check: https://github.com/dotnet/sdk/blob/be146734f2320ee3b0bb79457d1e8e6b21281fc8/src/Cli/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs#L129
GitHub
sdk/LaunchSettingsManager.cs at be146734f2320ee3b0bb79457d1e8e6b212...
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI - sdk/LaunchSettingsManager.cs at be146734f2320ee3b0bb79457d1e8e6b21281fc8 · dotnet/sdk
lycian
lycian2y ago
which I think just ends up being anything with a CommandName of "Project"
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?