41

As I said in my previous question I'm migrating my app to windows Metro app.

I'm getting an output like thisenter image description here

I don't understand this output, if anybody knows then this please say!

Community
  • 1
  • 1
Gopinath Perumal
  • 2,258
  • 3
  • 28
  • 41
  • 25
    The debugger is just telling you that it didn't load symbols for the .NET framework assemblies because you have "Just my code" debugging enabled. You can change that with Tools + Options + Debugging. But focus on debugging your own code instead of the framework code. – Hans Passant Nov 23 '12 at 13:27
  • 1
    You should post what you did to solve the problem, if any resolution was achieved. – PSGuy Jul 23 '17 at 07:33
  • off topic IMO, and [documented here](https://msdn.microsoft.com/en-us/library/dn457346.aspx) – Cee McSharpface Dec 17 '17 at 13:37

4 Answers4

41

Usually, you do not need the module load messages, but they are turned on in default.

Tools -> Options -> Debugging -> Output Window -> Module Load Messages -> Off

Istvan Heckl
  • 864
  • 10
  • 22
  • Thank you, I found this while reading the top answer and was amused to see this answered 5 hours ago! It's been bugging me (a little) for ages. – Astravagrant Apr 26 '19 at 16:55
  • 3
    What does it mean "Usually you don't need the module load messages"? Usually this is the key to understand why some breakpoint doesn't work or you can't debug some module. Turning on by default is good thing. – Ezh Oct 16 '20 at 08:33
20

When you run your application in the debugger, the debugger tries to locate the symbols of the code being run in order to allow you to set break points, view/change memory, examining the call stack etc...

As this task can introduce unwanted delays and/or could confuse the user under normal circumstances, Visual Studio is configured by default to skip the assemblies not being part of your solution. This is normally fine as you can focus on your code. However, there are case which you need to dig under your code to spot bugs not related to your code.

For this reason, the debugger is remembering you that the symbol is being skipped due to this setting, and the picture your are seeing is imcomplete as does not take into acccount what is not "yours".

You can disable this behaviour by unchecking the option Enable Just My Code under Tools->Options->Debugging.

Moreover, if you are interested in stepping through the .NET Framework code, you have to set the Enable .NET Framework source stepping option. Setting this option, also unsets the Enable Just My Code.

Yennefer
  • 5,704
  • 7
  • 31
  • 44
  • 3
    It would be also useful to know if there's a way to tell the compiler to put that annoying message just once. It is fine to debug just my code, I would not like to uncheck this option, but having all those messages in the output window makes hard to find importan stuff – zameb Oct 22 '18 at 06:37
  • To my knowledge, there is no way to have the compiler complain only once. – Yennefer Oct 22 '18 at 11:06
10

In VS Code, if you do not want to disable "Just My Code" (because you're fine with debugging just your own code), then you can get rid of these messages by adding this to you launch.json configs:

"logging": {
    "moduleLoad": false
}

On the other hand, if you really want to debug external code, then add this to your launch.json config instead:

"justMyCode": false

Find below a full sample config in launch.json for debug just your own code:

{
    // Use IntelliSense to find out which attributes exist for C# debugging
    // Use hover for the description of the existing attributes
    // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
    "name": ".NET Core Launch (web)",
    "type": "coreclr",
    "request": "launch",
    "preLaunchTask": "build",
    // If you have changed target frameworks, make sure to update the program path.
    "program": "${workspaceFolder}/src/YourProject/bin/Debug/netcoreapp3.1/YourProject.dll",
    "args": [],
    "cwd": "${workspaceFolder}/src/YourProject",
    "stopAtEntry": false,
    "justMyCode": true, // You can change to false if you wanna debug 3rd-party code
    "logging": {
        "moduleLoad": false
    },
    // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
    "serverReadyAction": {
        "action": "openExternally",
        "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
    },
    "env": {
        "ASPNETCORE_ENVIRONMENT": "Development"
    },
    "sourceFileMap": {
        "/Views": "${workspaceFolder}/Views"
    }
}
Alisson Reinaldo Silva
  • 10,009
  • 5
  • 65
  • 83
3

you could start the application without the debugger attached by pressing Ctrl+F5 from within the Visual Studio environment

this not a error. you only release debugging process from it.