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 The property 'program' is invalid for .dll file

See original GitHub issue

1. Setup: I have installed Visual Studio code on My Ubuntu and installed .NET Core and Mono.

2. Intial Configuration: I created a simple demo app running notnet restore and dotnet run. This simply works fine and display “Hello World!” on terminal.

3. Extension: To debug this, I installed extension of OmniSharp. and then using “Debugger” option of Visual Studio Code, I added launch.json & task.json.

4. launch.json (Only showing configuration section):

....
"configurations": [
    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/bin/Debug/netstandardapp1.5/hwAppCore2.dll",
        "args": [],
        "cwd": "${workspaceRoot}",
        "stopAtEntry": false
    }    
....

5. Now, when running from terminal it works fine, however when try to debug using option .NET Core Launch (console) I am getting following error:

“launch: The property ‘program’ is invalid. ‘/home/ak/dotnet_core/hwAppCore2/bin/Debug/netstandardapp1.5/hwAppCore2.dll’ is a library (.dll), not a program.”

I also followed one of Channel 9 demo, and there also I can see hwapp.dll configured for program property of launch.json

I am not sure, am I missing anything to configure?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
julielermancommented, May 18, 2016

well that’s embarrassing. Detritus from the placeholder and a “not seeing the trees for the forest” oversight when I was starting at the code for too long … so worried I had a typo in the path. After? LOL. And …I am now debugging aspnetcore right inside of VS Code! Hooray!!! Thanks.

1reaction
dmadden51commented, Mar 17, 2018

I just now installed VS Code today and started a tutorial. When running F5 or Ctrl-F5 I was getting an error that the .dll was not valid. The fix was easy and was due to the default entry not having the full path. image image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code debugger: launch.json The property ...
Visual Studio Code debugger: launch.json The property 'program' is invalid · You should launch dotnet with the arguments run <path to dll>. – ......
Read more >
Configure launch.json for C/C++ debugging in Visual Studio ...
A launch.json file is used to configure the debugger in Visual Studio Code. Visual Studio Code generates a launch.json (under a .vscode folder...
Read more >
VS Code | Build, Run and Debug in C++ - GeeksforGeeks
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 >
Host and deploy ASP.NET Core Blazor WebAssembly
Learn how to host and deploy Blazor WebAssembly using ASP.NET Core, Content Delivery Networks (CDN), file servers, and GitHub Pages.
Read more >
Learn How to Debug PHP with Xdebug and VsCode
VSCode will now add a launch.json file in the root directory. launch file. Finally, add the runtimeExecutable property to the list after port:...
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