Skip to content

dotnet run swallows -bl arguments even if they follow double dash (--) #54715

@jjonescz

Description

@jjonescz

Describe the bug

dotnet run -- -bl should run an app and pass -bl to it as command-line argument. Instead dotnet run itself uses the -bl argument.

Steps to reproduce

Create a simple command-line app that can echo its arguments, for example:

Console.WriteLine($"args({args.Length}):{string.Join(";", args)}");
  • dotnet run -- --no-build -> args(1):--no-build OK
  • dotnet run -- -bl -> args(0): WRONG

Expected behavior

-bl should be passed to the app since it's after --.

Actual behavior

-bl is consumed by dotnet run CLI.

Is this a regression?

No.

Are there any workarounds?

No.

dotnet --info output

.NET 10.0.300

IDE version

No response

Other details

No response

Metadata

Metadata

Labels

Area-RunIssues relating to `dotnet run`untriagedRequest triage from a team member

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions