dotnet/vscode-csharp

Debugging failed as unable to generate "launch.json" in VSCode.

dandanmu opened this issue · 0 comments

Environment data

dotnet --info output:
.NET SDK (reflecting any global.json):
Version: 6.0.100-alpha.1.21064.46
Commit: 76b9d0ff50

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-alpha.1.21064.46\

Host (useful for support):
Version: 6.0.0-alpha.1.21063.13
Commit: 6ded57b3d2

.NET SDKs installed:
6.0.100-alpha.1.21064.46 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-alpha.1.21063.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-alpha.1.21063.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0-alpha.1.21063.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

VS Code version:1.52.1
C# Extension version:1.23.8

Steps to reproduce

• Create new .NET 6.0 console application(con60) with reference to a .NET Standard 2.1 class library(cla21) via CLI,
• Open it via VSCode
• Debug the app – Put breakpoint in the code and press F5
image

Expected behavior

Debug could succeed.

Actual behavior

• It shows a prompt message that “Could not find the task 'build'”
image
• Then open “launch.json”, press “Add Configuration…”, and the "launch.json" file generated with warning:
"WARNING01": "",
"WARNING02": "The C# extension was unable to automatically decode projects in the current",
"WARNING03": "workspace to create a runnable launch.json file. A template launch.json file has",
"WARNING04": "been created as a placeholder.",
"WARNING05": "",
"WARNING06": "If OmniSharp is currently unable to load your project, you can attempt to resolve",
"WARNING07": "this by restoring any missing project dependencies (example: run 'dotnet restore')",
"WARNING08": "and by fixing any reported errors from building the projects in your workspace.",
"WARNING09": "If this allows OmniSharp to now load your project then --",
"WARNING10": " * Delete this file",
"WARNING11": " * Open the Visual Studio Code command palette (View->Command Palette)",
"WARNING12": " * run the command: '.NET: Generate Assets for Build and Debug'.",
"WARNING13": "",
"WARNING14": "If your project requires a more complex launch configuration, you may wish to delete",
"WARNING15": "this configuration and pick a different template using the 'Add Configuration...'",
"WARNING16": "button at the bottom of this file.",
"WARNING17": "
",
image