符号问题 - 无法进入 .NET 代码
我无法使 Visual Studio 2010 SP1 进入任何 .NET Framework 类,我在互联网上找到了很多指南,但没有一个有效...
这是输出窗口的内容:
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_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 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.
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...
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 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简短回答: http://referencesource.microsoft.com/downloadsetup.aspx
长答案:
一般来说,PDB 文件只是源代码和汇编 IL 代码之间的映射。为了使其工作,您需要将源代码下载到 PDB 中“硬编码”的位置。
您只需在文本查看器中查看 PDB 文件即可找到此位置。例如,如果您看到 System.pdb,您将看到类似这样的行:
有一些记录不详的方法来覆盖此行为,但这是另一个故事。
您还需要确保在 Visual Studio 中正确配置了调试设置:
Tools\Options\Debugging\General
您可以从 此处。
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:
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.
文章< Philipp Munin 提到的 /a> 逐步解释了如何单步调试(调试).NET Framework 代码。但是,如果您不想下载整个框架并希望单步执行特定的程序集,则可以遵循稍微简单的过程:(
这些是在 VS2015 中测试的,其中调试选项与 VS2010 中的调试选项略有不同)
确保您可以单步执行您自己的其他代码:
调试→选项→常规
确保加载程序集的符号(例如
System.Data.dll
)您可能不清楚 Microsoft 符号服务器,因为符号已被缓存。
现在您可以单步执行
System.Data.dll
中定义的类的方法。明显的副作用:如果启用(抛出)异常,许多异常可能会中断应用程序启动(框架内“隐藏”异常)。这可以通过取消选中特定异常类型或手动附加(或重新附加) 应用程序启动完成后。
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)
Ensure that you can step into other code that your own:
Debug → Options → General
Make sure that symbols for your assembly are loaded (e.g.
System.Data.dll
)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.