'Disable verbose logging of symbol loading in vscode debug console

When running my webapp (in vscode), the debug console is filled with lines like these:

Loaded '/foo/bar/dotnet/shared/Microsoft.NETCore.App/2.2.4/System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

and

The thread 123 has exited with code 0 (0x0).

I thought this has something to do with log filtering in the appsettings.json file, but these don't belong to any category I can disable.

This is very annoying - how do I disable it?



Solution 1:[1]

These logs are managed by VS Code. You can disable them in the launch.json file in the .vscode directory. You can add the following node under the configurations node to disable module load messages:

"logging": {
    "moduleLoad": false
}

There are more options available such as exceptions and programOutput, check out the Intellisense for all available options.

Solution 2:[2]

I came to this answer looking for the same thing as the original question was. The answer provided here was correct but I did not understand where I needed to put it. So I decided to add my own answer in hopes of guiding others in the same situation...

All you need to add is the following code to your solution (or project file if you are not working with a solution).

"logging": {
    "moduleLoad": false
}

Because it was not clear to me where it needs to be added (there was two separate areas un my "configurations" node called "name": ".NET Core Launch (console)" and "name": ".NET Core Attach"), I wanted to post my entire config to make it much more clear.

"version": "0.2.0",
"configurations": [
    {
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/example.dll",
        "args": [],
        "cwd": "${workspaceFolder}",
        "console": "internalConsole",
        "stopAtEntry": false,
        "logging": {
            "moduleLoad": false
        }
    },
    {
        "name": ".NET Core Attach",
        "type": "coreclr",
        "request": "attach",
        "processId": "${command:pickProcess}"
    }
]

Solution 3:[3]

The solution in the accepted answer doesn't work when debugging Blazor projects.

Use this instead:

"dotNetConfig": {
  "logging": { "moduleLoad": false }
}

Solution 4:[4]

The answer correctly explains how to disable logging in the general case (by editing .vscode/launch.json).

But that doesn't work for a debug session started from codelens:

Start debug session from codelens

In that case edit .vscode/settings.json:

"csharp.unitTestDebuggingOptions": {
  "logging": { "moduleLoad": false }
},

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Henk Mollema
Solution 2 Arvo Bowen
Solution 3 lonix
Solution 4 lonix