Skip to content

dotnet cli doesn't seem to respect profile / launch file / command line arguments #23565

@Swiftly1

Description

@Swiftly1

I added launchSettings via VS2022 GUI

obraz

it looks like that:

{
  "profiles": {
	"LaunchSettingsQuirks": {
	  "commandName": "Project",
	  "commandLineArgs": "--test"
	}
  }
}

when I run program via VS with that profile then it prints

args:
--test

but when I run it via

dotnet run or

dotnet run --launch-profile LaunchSettingsQuirks or

dotnet run --launch-profile "LaunchSettingsQuirks"

then it doesn't, it just prints

args:

when I use name of the profile that does not exist, then the error is displayed correctly

dotnet run --launch-profile test
The launch profile "test" could not be applied.
A profile with the specified name could not be found or is not a valid JSON object.

Repo: https://github.com/Swiftly1/LaunchSettingsQuirks

dotnet --version
6.0.101

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions