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.

launch.json cannot detect the project binary

See original GitHub issue

Environment 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:

  1. 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.
  2. Run dotnet new
  3. Run dotnet restore
  4. Choose debug page on sidebar, click on run button, and select launch.json profile to “.net Core”
  5. Click on Set task runner, but it only generate a default file, apperently there is nothing to set.
  6. Paste the exact path of main dll to program attribute of configuration of launch.json, as being said, otherwise the debugger won’t work.
  7. Start Debugging

Expected behavior

What we really want:

  1. New folder
  2. Run dotnet new in it.
  3. Start Debugging

I wonder if it is possible. Is this the wrong place to report the issue?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TheIdanLapidcommented, Aug 28, 2018

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.

1reaction
DustinCampbellcommented, Feb 3, 2017

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure launch.json for C/C++ debugging in Visual Studio ...
Visual Studio Code generates a launch.json (under a .vscode folder in your project) with almost all of the required information.
Read more >
Cannot find runtime 'node' on PATH - Visual Studio Code ...
On OSX and VSCode 1.56.2 all I had to do was to close and restart VSCode and the problem went away.
Read more >
The launch.json file for the DevTools extension
Learn how to customize tasks to provide some configuration details to run and debug a codebase that Visual Studio doesn't recognize. Install ....
Read more >
VS Code | Build, Run and Debug in C++
Firstly create a file launch.json that configures the VS Code to launch the GDB debugger at the beginning of the debugging process.
Read more >
Debugging Go with VS Code
After you save the launch.json configuration, the DEBUG CONSOLE at the bottom of the editor window will display your project's output. The debug...
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