locked
Skipped loading symbols RRS feed

  • Question

  • I wrote this really simple code to get started learning C#

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace ConsoleApplication2
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("hello world");
            }
        }
    }
    

    Visual Studio community gives me any error of coding but when i debug it it doesn't show me the console .

    I watched the output window :

    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\Users\Michelangelo\documents\visual studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    The thread 0x2040 has exited with code 0 (0x0).
    The thread 0x24cc has exited with code 0 (0x0).
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\Users\Michelangelo\documents\visual studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe'. Symbols loaded.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'ConsoleApplication2.vshost.exe' (CLR v4.0.30319: ConsoleApplication2.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'. Symbols loaded.
    The thread 0xd74 has exited with code 0 (0x0).
    The thread 0x13e4 has exited with code 0 (0x0).
    The program '[6096] ConsoleApplication2.vshost.exe' has exited with code 0 (0x0).

    and i think there is a problem with the sybols ... I watched other question in this forum but i didn't solved the problem ... Anyone can help me ?

    Sunday, February 7, 2016 9:49 AM

Answers

  • Then doing a 'Continue' (F5) the console-window closes and in Visual Studio Output window there is something like this? 
    'The program '[0xXXXX] <YourApplication> has exited with code 0 (0x0).'
    No 'Exception' message? So I think, you are fine.
    In case you want that console-window stays open, you may add to your code

    string line = Console.ReadLine();
    Then application waits for user input and closes then.

    Wit kind regards

    Tuesday, February 9, 2016 2:36 PM
  • Not quite sure, if I understand correctly. We just did an example debugging session, to verify correct behaviour of Visual Studio.
    For certainly there are sometimes problems with symbol-loading, hitting breakpoints, stepping in code, unexpected exceptions, applications, which for one reason or the other refuse to start.
    And as far as I can see, all is ok on your box.
    But that does not mean, you have to single step (F10) after a breakpoint or have to add Console.ReadLine (I just added it, for you said, 'it doesn't show me the console' ), that was just to prove functionality.
    E.g. if you have added Console.ReadLine you need not set a breakpoint. You may try, after debugging has started, do a 'Debug->Break All' ... then inspect variables, call-stack ...
    It just depends what you want to achieve, for normally you debug, because program does not behave as desired or diagnose bugs or just out of curiosity.
    Here are some basics:
    https://blogs.msdn.microsoft.com/visualstudio/2015/08/11/introduction-to-debugging/

    With kind regards
     
    Tuesday, February 9, 2016 4:12 PM

All replies

  • Hi mikiIN8bit,

    >>Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

    (1)uncheck the option under Tool > Options-> Debugging > General > Enable Just My Code.

    (2) clear the checkbox "Optimize code"

    (3) Please also change the platform target(X86/X64/Any CPU), debug it again.

    (4) Please check the Modules windows, and check which symbols really impact the debugging results.

    Reference:

    https://social.msdn.microsoft.com/Forums/en-US/74a90d81-4687-4ffb-aaaf-6913f1206dba/skipped-loading-symbols-module-is-optimized-and-the-debugger-option-just-my-code-is-enabled?forum=vsdebug

    Thanks,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 8, 2016 2:15 PM
  • Hi Jack-Zhai 

    Thank you for your answer. 

    I don't understand how to use the module windows ....  I read there https://msdn.microsoft.com/en-us/library/4c8f14c9.aspx that i have to do debug>windows>modules but in my visual studio community there is no modules option , i have only : breapoints , exception settings , output and immediate . 

    Monday, February 8, 2016 2:51 PM
  • Modules window is only accessible, while you debug under Debug->Windows->Modules. E.g. in your case, I'd set a breakpoint at Console.WriteLine, then F5 ...
    https://www.visualstudio.com/en-us/get-started/code/debug-your-app-vs
    'Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.' is not an error.
    It just reminds you, that symbol-loading for 'system' modules is disabled in Debug->Options... dialog, symbols you normally will not need as a beginner. Here is some info about symbols:
    https://blogs.msdn.microsoft.com/visualstudioalm/2015/01/05/understanding-symbol-files-and-visual-studios-symbol-settings/

    With kind regards

    Monday, February 8, 2016 5:59 PM
  • In the module windows there are some problems i think...  "Symbols not loaded" and "Binary was not built with debug information " 

    I hope i am near the solution of this problem !

    Monday, February 8, 2016 8:16 PM
  • I watched the result from the modules windows and i think there are some problems ... "symbols not loaded" and  "Binary was not built with debug information" .

    I hope that im near the solution of this problem !

    Thanks for your time .

    Monday, February 8, 2016 8:56 PM
  • Please have in mind, not all modules from MS will be built with debug-info or sometimes pdb-files will be missing on MS-symbol-server - which does not hinder successful debugging.
    For you are able to access module-window, I assume symbols are loaded for module for your ConsoleApplication2? What happens, if you 'Step over' (think it's F10) after hitting BP?

    With kind regards

    Monday, February 8, 2016 10:05 PM
  • Scuse me but i am Italian so i didn't really understood what i have to do .... "BP" and "MS" what does it means ? 

    Really sorry for my ignorance <.<

    Tuesday, February 9, 2016 12:19 PM
  • Never mind, English is also not my mother language - so maybe it was a little unclear. MS is Microsoft. Sometimes the pdb-files, Visual Studio wants to download are missing on their symbol-server - probably they want to protect their intellectual property or just by chance.
    But they are not that important for debugging your application. You can normally ignore this.
    BP is breakpoint. So question was: will the breakpoint be hit at Console.WriteLine after you started debugging (F5) - which would indicate symbols are loaded for your exe-module
    And if so, and you do a step (F10), will your console-application show output "Hello World"?

    With kind regards
    Tuesday, February 9, 2016 1:23 PM
  • Now i think i understood ! Yes when after i press F10 in can see in the console "hello word " .
    Tuesday, February 9, 2016 1:52 PM
  • Then doing a 'Continue' (F5) the console-window closes and in Visual Studio Output window there is something like this? 
    'The program '[0xXXXX] <YourApplication> has exited with code 0 (0x0).'
    No 'Exception' message? So I think, you are fine.
    In case you want that console-window stays open, you may add to your code

    string line = Console.ReadLine();
    Then application waits for user input and closes then.

    Wit kind regards

    Tuesday, February 9, 2016 2:36 PM
  • In there is this message "The program '[4728] ConsoleApplication3.vshost.exe' has exited with code 0 (0x0)." so i think it's good .

    In conclusion , when i have to program , i have to add a brakpoint , build it and then press F10 and it will be all good ... right ? Or simply add that simply line of code 

    string line = Console.ReadLine();
    • Edited by mikiIN8bit Tuesday, February 9, 2016 3:01 PM
    Tuesday, February 9, 2016 3:00 PM
  • Not quite sure, if I understand correctly. We just did an example debugging session, to verify correct behaviour of Visual Studio.
    For certainly there are sometimes problems with symbol-loading, hitting breakpoints, stepping in code, unexpected exceptions, applications, which for one reason or the other refuse to start.
    And as far as I can see, all is ok on your box.
    But that does not mean, you have to single step (F10) after a breakpoint or have to add Console.ReadLine (I just added it, for you said, 'it doesn't show me the console' ), that was just to prove functionality.
    E.g. if you have added Console.ReadLine you need not set a breakpoint. You may try, after debugging has started, do a 'Debug->Break All' ... then inspect variables, call-stack ...
    It just depends what you want to achieve, for normally you debug, because program does not behave as desired or diagnose bugs or just out of curiosity.
    Here are some basics:
    https://blogs.msdn.microsoft.com/visualstudio/2015/08/11/introduction-to-debugging/

    With kind regards
     
    Tuesday, February 9, 2016 4:12 PM