I am trying to run a console app in debug mode using VSCode.
My .sln file is in a "src" folder (see ).
I have multiple projects in the solution: a web API, a class library, and a console exe. I want to launch the console in debug mode.
My launch.json file is as follows:
{
"version": "0.2.0",
"configurations": [
{
"name": "ArcadeManager Console",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/ArcadeManager.Console/bin/Debug/net8.0/ArcadeManager.Console.dll",
"args": [],
"cwd": "${workspaceFolder}/src/ArcadeManager.Console",
"stopAtEntry": false,
"console": "internalConsole"
}
]
}
When I try to run the configuration, I get the following:
Executing task: C:\Program Files\dotnet\dotnet.exe build C:\Dev\arcademanager/ArcadeManager.sln /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary;ForceNoAlign
MSBUILD : error MSB1009: Le fichier projet n'existe pas. Commutateur : C:\Dev\arcade-manager/ArcadeManager.sln
As you can see it searches for the proper file, but not in the proper folder?
How do I specify it the proper path to the sln file?
Thanks!
I am trying to run a console app in debug mode using VSCode.
My .sln file is in a "src" folder (see https://github/cosmo0/arcade-manager).
I have multiple projects in the solution: a web API, a class library, and a console exe. I want to launch the console in debug mode.
My launch.json file is as follows:
{
"version": "0.2.0",
"configurations": [
{
"name": "ArcadeManager Console",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/ArcadeManager.Console/bin/Debug/net8.0/ArcadeManager.Console.dll",
"args": [],
"cwd": "${workspaceFolder}/src/ArcadeManager.Console",
"stopAtEntry": false,
"console": "internalConsole"
}
]
}
When I try to run the configuration, I get the following:
Executing task: C:\Program Files\dotnet\dotnet.exe build C:\Dev\arcademanager/ArcadeManager.sln /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary;ForceNoAlign
MSBUILD : error MSB1009: Le fichier projet n'existe pas. Commutateur : C:\Dev\arcade-manager/ArcadeManager.sln
As you can see it searches for the proper file, but not in the proper folder?
How do I specify it the proper path to the sln file?
Thanks!
Share edited Mar 4 at 9:20 thomasb asked Mar 3 at 21:14 thomasbthomasb 6,05510 gold badges60 silver badges94 bronze badges 2 |1 Answer
Reset to default 1Ok so I found the culprit.
In the files explorer (not the .Net solution explorer, not the debug panel) there is a file .vscode\tasks.json
which is documented here: https://code.visualstudio/docs/editor/tasks
It turns out this is what launch.json
is referring to in the preLaunchTask
property: the name of an entry in the tasks list.
Here the build
task was in fact defined with the wrong path to the sln file.
dotnet run
instead of starting the application. Basically, this kind of configuration can work ignoring the solution. I have a big code repository and several articles (series incomplete) in solution structure, can point you there. You need to know quite a bit on .NET MSBuild and configurations. – Sergey A Kryukov Commented Mar 3 at 23:33