Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code .NET Core project shows verbose debug console messages

I am new to Visual Studio Code. However, one thing thing that I noticed with one of the projects that I have is really bugging me. Whenever, I run the project in Visual Studio Code using its in-built debugger, it shows me a message which looks like following:

Loaded /usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enable

And it shows that message for each DLL file that I have referenced. This causes huge amount of unwarranted logs in my Debug Console.

  • Why does it show this information?
  • Is it possible to get rid of it?
like image 278
Lost Avatar asked May 08 '18 01:05

Lost


People also ask

How do I get rid of Debug console in vscode?

Note : You can use same shortcut key to clear both debug console as well as terminal with “ctrl+k” key shortcut.

How do I Debug a .NET core code in Visual Studio?

Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.


1 Answers

Applies to dotnet core 2.2, unverified anywhere else

I just found a way to get rid of most of this noise using the logging options. Unfortunately, I still see some program output like thread info because we currently have logging going to the console. I haven't completely set it up the way I like, but this works better for now.

In ./.vscode/launch.json, add the logging options to your config:

"configurations": [
        {
            "name": "Your config name",
            "type": "coreclr",
            "request": "launch",
            "logging": {
                "engineLogging": false,
                "moduleLoad": false,
                "exceptions": false,
                "browserStdOut": false
            },
// ... the rest of your existing config. surrounding code shown for placement purposes.

You may still want exceptions output to the console, but so far I've found that even handled exceptions are being logged. I want to ignore those, so I've set exceptions to false here.

like image 84
ps2goat Avatar answered Sep 28 '22 04:09

ps2goat