Passing program arguments with dotnet run fails with the option -d (6.0.100-preview.1.21103.13)
See original GitHub issuePassing command line arguments to the application with dotnet run doesn’t show an argument passed if the argument -d is passed.
Application with top-level statements:
System.Console.WriteLine($"length: {args.Length}");
Project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
</PropertyGroup>
</Project>
Running the application with
dotnet run -- -a
is as expected. Using
dotnet run -- -d
give this argument count: 0.
The issue happens when this SDK is used (on Windows): 6.0.100-preview.1.21103.13
Creating a global.json
file and set the version number to 5.0.103, the program runs as expected.
I’m running Windows 10, build 21322.1000
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Christian Nagel
Passing program arguments with dotnet run fails with the option -d (6.0.100-preview.1.21103.13) ·... Passing command line arguments to the application with ...
Read more >Chocolatey Software | FAKE - F# Make 5.21.1
Some Checks Have Failed or Are Not Yet Complete ... Verification Testing Passed ... run the following command from the command line or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yup, thanks, simple fix out here: https://github.com/dotnet/sdk/pull/19086
@joeloff I also can reproduce this bug. You should change ‘for consideration’ to bug.