question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet run needs a way to pass through arguments starting with - or -- to the executable

See original GitHub issue

I have an executable that supports a --foo argument. However, running dotnet run --foo does not work since the run command attempts to parse it (invalid option --foo). We need a way to pass through any arguments that aren’t consumed by the run command to the executable being launched. This might also apply to the dotnet test command.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
plioicommented, Jun 15, 2016

+1

“dotnet test” without passing through arguments cripples those of us wishing to port test frameworks to .NET Core.

7reactions
PRIMETSScommented, Apr 8, 2018

Thnaks, but is this meant to work when launching from VS2017 using IISExpress Have below in launchSettings.json, from below UI in VS

"profiles": { "IIS Express": { "commandName": "IISExpress", "commandLineArgs": "-- -c \"D:/DATA/My Projects/2018/LIS/Config.xml\"", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } },

image

But public static void Main(string[] args) is always empty

However does work from command line with

dotnet run – -c “D:/DATA/My Projects/2018/LIS/Config.xml”

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet run needs a way to pass through arguments starting ...
I have an executable that supports a --foo argument. However, running dotnet run --foo does not work since the run command attempts to...
Read more >
dotnet run command - .NET CLI
Delimits arguments to dotnet run from arguments for the application being run. All arguments after this delimiter are passed to the ...
Read more >
Pass command-line arguments to Startup class in ASP. ...
You should be able to use the AddCommandLine() extension. First install the Nuget package Microsoft.Extensions.Configuration.
Read more >
Run and debug .NET executables without source code
Specify the path to the target executable. Optionally, specify program arguments that will be passed to the executable when the configuration is ...
Read more >
How to start a service with certain start parameters on ...
It should give you a list of all the running services so you can get the actual service name. Then just use net...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found