A
A
Akly2020-12-07 16:08:27
C++ / C#
Akly, 2020-12-07 16:08:27

Console debugger not working in Visual Studio Code. What to do?

Greetings. I'm generally new to both C# and Visual Studio Code. I took the usual course, and when you need to write something to the console, it does not respond. Everything works for the author of this code, but he uses the usual Visual Studio. Maybe I'm writing to the wrong console?
PS I run the program both with debugging and without debugging - it doesn't help.5fce292c62dc7541318609.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2020-12-07
@vabka

You need to set a breakpoint.
5fce2f4caed99004173505.png
My launch.json and task.json

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

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "shell",
            "args": [
                "build",
                // Ask dotnet build to generate full paths for file names.
                "/property:GenerateFullPaths=true",
                // Do not generate summary otherwise it leads to duplicate errors in Problems panel
                "/consoleloggerparameters:NoSummary"
            ],
            "group": "build",
            "presentation": {
                "reveal": "silent"
            },
            "problemMatcher": "$msCompile"
        }
    ]
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question