-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Closed
Copy link
Labels
Area-run-fileItems related to the "dotnet run <file>" effortItems related to the "dotnet run <file>" effort
Milestone
Description
Describe the bug
Passing a filename as an argument using the dotnet App.cs command isn’t working.
There is a bug in the argument validation part.
To Reproduce
if (args.Length == 0)
{
Console.WriteLine("Filename input is not provided.");
return;
}
Console.WriteLine($"{Path.Combine(Environment.CurrentDirectory, args[0])}");- Save this snippet to a file named, say App.cs.
- Then run dotnet App.cs.
- Will print the Console message requesting the filename input.
- Now run dotnet App.cs App.cs.
- It's still printing the earlier Console message as part of input validation.
- Now pass the input without the file extension, like dotnet App.cs App
- Will print the absolute path of the input, of course, without the file extension.
- There is a bug in the argument validation part when the argument has a dot in it.
Exceptions (if any)
Further technical details
details of dotnet --info
Metadata
Metadata
Assignees
Labels
Area-run-fileItems related to the "dotnet run <file>" effortItems related to the "dotnet run <file>" effort