Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

296
Views
Visual studio WLS2 debugging and command line argument

Im trying to debug a .net core console application in visual studio 2019 and WLS2. The console application requires a command line argument at startup.

This my launchSettings.json

{
  "profiles": {
    "ConsoleApp": {
      "commandName": "Project",
      "commandLineArgs": "--s",
    },
    "WSL 2": {
      "commandName": "WSL2",
      "commandLineArgs": "--s",
      "distributionName": ""
    }
  }
}

Starting the debug session with "ConsoleApp" profile the application console get the argument "--s" as expected, but executing the debug in WSL with "WSL 2" profile I get the following message:

Unknown option: --s

.NET Core SDK (3.1.404)

Usage: dotnet [runtime-options] [path-to-application] [arguments]
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The commandLineArgs for WSL2 when not provided is defaulted to the name of the dll. When you provide one explicitly you must also provide the dll name along with the arguments. If your project name is MyNamespace.MyProject, update your launchsettings as follows:

"WSL 2": {
  "commandName": "WSL2",
  "commandLineArgs": "MyNamespace.MyProject.dll --s",
  "distributionName": ""
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!