开发者

Issue with Symbols - can't step into .NET code

开发者 https://www.devze.com 2023-03-19 01:52 出处:网络
I can\'t make Visual Studio 2010 SP1 step into any .NET Framework class, I\'ve found many guides in internet, but none of them work...

I can't make Visual Studio 2010 SP1 step into any .NET Framework class, I've found many guides in internet, but none of them work...

Issue with Symbols - can't step into .NET code

Here's the what output window says:

Step into: Stepping over method without symbols 'System.Collections.Generic.SortedSet<Shared.Optimization.Solution<GaTest.CurveFitSimplex,double>>.Remove'

Here is whole Output window contents:

'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Lu4\documents\visual studio 2010\Projects\Estimator\GaTest\bin\Debug\GaTest.vshost.exe', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll', Symbols开发者_C百科 loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Symbols loaded.
The thread 'vshost.NotifyLoad' (0x1444) has exited with code 0 (0x0).
The thread '<No Name>' (0x3d8) has exited with code 0 (0x0).
The thread '<No Name>' (0x10a8) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0xc40) has exited with code 0 (0x0).
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Lu4\documents\visual studio 2010\Projects\Estimator\GaTest\bin\Debug\GaTest.exe', Symbols loaded.
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Lu4\documents\visual studio 2010\Projects\Estimator\GaTest\bin\Debug\Shared.dll', Symbols loaded.
Step into: Stepping over method without symbols 'System.Collections.Generic.SortedSet<Shared.Optimization.Solution<GaTest.CurveFitSimplex,double>>.Remove'
'GaTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Symbols loaded.


Short answer: http://referencesource.microsoft.com/downloadsetup.aspx

Long answer:

Generally PDB Files are just maps between source code and assembly IL code. To make it work you need to have source code downloaded to the location "hardcoded" in PDB. You can find this location just viewing PDB file in text viewer. For instance if you see System.pdb, you will see lines like that:

f:\dd\ndp\fx\src\net\system\net\websockets\websocketconnectionstream.cs f:\dd\ndp\fx\src\services\monitoring\system\diagnosticts\eventloginternal.cs

There are some poorly documented methods to override this behavior, but it's another story. You also need to make sure you have properly configured debug settings in your visual studio: Tools\Options\Debugging\General

You can download source code and detailed instructions from here.


The article mentioned by Philipp Munin explains step by step how to be able to step into (debug) .NET Framework code. However, if you do not wish to download the whole framework and want to step into a particular assembly, a slightly easier procedure can be followed:

(these are tested in VS2015 where debugging options are slightly different from those in VS2010)

  1. Ensure that you can step into other code that your own:

    Debug → Options → General

    • Enabled Just My Code must be cleared
    • Enable .NET Framework source stepping must be checked (this will trigger a download of symbols from time to time when attached to process, but may be cancelled)
    • Step over properties and operators should be cleared
    • Enabled source server support should be checked
  2. Make sure that symbols for your assembly are loaded (e.g. System.Data.dll)

    • Go to Debug → Windows → Modules
    • Filter for System.Data.dll
    • Right-click → Symbol settings → Check Microsoft Symbol Servers
    • Right-click again → Load symbols

You may unclear Microsoft Symbol Servers, since symbols have been cached.

Now you can Step into methods of classes defined in System.Data.dll.

Noticeable side effect: if exceptions are enabled (thrown), many exceptions may interrupt application startup ("burried" exceptions withing the framework). This can be dealt by either unchecking particular exception types or by manually attaching (or Reattaching) after the application startup is done.

0

精彩评论

暂无评论...
验证码 换一张
取 消