launch.json cannot detect the project binary
See original GitHub issueEnvironment data
Product Information: Version: 1.0.0-preview2-1-003177 Commit SHA-1 hash: a2df9c2576 Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64 VS Code version: 1.8.1 C# Extension version:1.6.2
Steps to reproduce
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"externalConsole": false
},
launch.json
For "program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
, you must find and paste in the exact path of the dll file like ${workspaceRoot}/bin/Debug/netcoreapp1.1/project1.dll
in order to hook the debuger up. In this case, what’s the point of having the wildcard placeholder anyway?
IMO, the real issue here is the project kick-starting process is way too tedious for a console project.
Actual behavior
You see, to start the project, we have to go through following steps:
- We can only put the
bin
folder under the root folder, otherwise the.vscode/
will not work. If we need more than one project -> Open more than one new windows, instead of creating multiple sub-folder in the same workspace. - Run
dotnet new
- Run
dotnet restore
- Choose debug page on sidebar, click on run button, and select
launch.json
profile to “.net Core” - Click on Set task runner, but it only generate a default file, apperently there is nothing to set.
- Paste the exact path of main dll to program attribute of configuration of launch.json, as being said, otherwise the debugger won’t work.
- Start Debugging
Expected behavior
What we really want:
- New folder
- Run
dotnet new
in it. - Start Debugging
I wonder if it is possible. Is this the wrong place to report the issue?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
dotnet new Prints: “Usage: new [options]… (and then the rest of the help text)”
dotnet restore Prints: “Nothing to do. None of the projects specified contain packages to restore.”
But still I can’t run the program.cs with F5 because of this line in launch.json: “program”: “${workspaceFolder}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll”
I don’t have a bin/Debug folder in my sln folder because I couldn’t even debug it once. I’m stuck on this error before it even starts debugging/running.
Thanks very much for your feedback @qiansen1386. I’m going to go ahead and close this, as we already have at least one issue tracking further work. Do let us know if you have further feedback. Thanks!