Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

307
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda