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.

Missing Launch.json Auto-Creation for dotnetcore classlib template

See original GitHub issue

Environment data

dotnet --info output: .NETCore SDK version 2.1.400 VSCode version 1.29.1 (latest in time of writing this) CsharpExtension version 1.17.1 OS Windows x64

Steps to reproduce

All the problem is creating, building and debugging the dot net core class library.

Expected behavior

when I create a Console project using this command : dotnet new console -o A1 , the C# extension automatically create bin folder and ask me :

required assets to build and debug are missing from Console, Add them ? image

.

and after clicking yes, the extension creates and configured launch.json and task.json for me :

image and after pressing F5 , it compiles and builds successfully. But …

Actual behavior

But when I create class library using this command : dotnet new classlib -o A1 the extension does NOT show me any notification that ask me if I would like to add assets or not I mean the extension does NOT create Launch.json and Task.json for me and clearly does not configure them. image . When I press F5 the command palette asks me to select my environment and I click on .Net Core Then it generates Launch.json for me BUT Wrongly and when I press F5 to build it , I get this Error :

Could not find the task ‘build’

image

this is too annoying to have this behavior in this rich text editor and extension. Thank you for your good Extension 🥇

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
alexanderdpcommented, Jun 18, 2019

OMFG why so much overhead and problems to have a simple extension work! What a waste of time! It’s just easier to launch VS17/19 and test code in a new file or use dotnetfiddle.net to run quick code tests. I was under the impression that VSCode extensions was supposed to be light weight and quick!

Thumbs down…

2reactions
parsalotfycommented, Nov 26, 2018

Thank you, I know the scenario is generic but I think it would be a good idea to have a default behavior for building the library. any way , I write my Launch.json and Task.json here for those who have my problem because I was searching in google for hours and I did not come up with solution in the net. thanks again 👍

My Launch.json configuration for building my class library with F5

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch lib",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/lib/bin/Debug/netstandard2.0/lib.dll",
            "args": [],
            "cwd": "${workspaceFolder}/lib",
            "stopAtEntry": false,
            "console": "integratedTerminal"
        }
    ]
}


My Task.json configuration for building my class library with F5.

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "process",
            "group": "build",
            "args": ["build","${workspaceFolder}/lib"],
            "problemMatcher": "$msCompile"
        }
    ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration '.NET Core Attach' is missing in 'launch.json'.
To SIMPLY create a base c# console app, results in this error. Configuration '.NET Core Attach' is missing in 'launch.json'.
Read more >
C# - VS Code - launch:program ... does not exist
Go to launch.json file in VS: Replace: "program": "${workspaceFolder}/bin/Debug//.dll",. With: "program ...
Read more >
The launch.json file for the DevTools extension - Microsoft Learn
The launch.json file for the Microsoft Edge DevTools extension for Visual Studio Code, for advanced customization of debug configurations.
Read more >
How to manually configure Visual Studio Code for Debugging ...
Then Launch Visual Studio Code. ... In this example, the new folder will be called coding. ... VS Code creates a default launch.json...
Read more >
Run and debug .NET Core and ASP.NET Core apps with ...
json. The example below shows a sample launchSettings.json with two launch profiles: IIS Express and Sample .
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