Visual Studio 2010 - 无法单步执行.NET Framework 4源代码(PresentationCore.dll)

时间:2021-10-16 08:19:33

The problem: I'm getting a nullref inside of System.Windows.Interop.HwndKeyboardInputProvider's FilterMessage method that I'd really like to try to debug, but without being able to step through the source I'm not sure what else to do.

问题:我在System.Windows.Interop.HwndKeyboardInputProvider的FilterMessage方法中得到一个nullref,我真的想尝试调试,但是无法单步执行源代码我不知道还能做什么。

I've tried Setting up Visual Studio 2010 to allow me to step through the .NET Framework source (specifically System.Windows.Interop.HwndKeyboardInputProvider's FilterMessage method, in PresentationCore.dll). I'm having trouble getting my visual studio to display .NET source for debugging. I've followed various different articles/blog entires, but nothing seems to be working. What I've tried:

我已经尝试过设置Visual Studio 2010以允许我逐步浏览.NET Framework源代码(特别是在PresentationCore.dll中的System.Windows.Interop.HwndKeyboardInputProvider的FilterMessage方法)。我无法让我的visual studio显示.NET源代码进行调试。我已经关注了各种不同的文章/博客,但似乎没有任何工作。我尝试过的:

In the VS2010 Options->Debugging menu, enabling "Enable .NET Framework source stepping", enaling "Enable source server support", disabling "Require source files to exactly match the original version", following the instructions here: (http://blogs.microsoft.co.il/blogs/arik/archive/2010/07/12/step-into-net-framework-4-0-source-code.aspx) and installing the reference source and setting up VS to use the symbol files included with the reference source, along with several other attempts based on articles/blog entries online. Using that method, I can see in my modules window that the symbols for PresentationCore.dll are being loaded, but I still get the "No source available" window when trying to step into the area I'm trying to debug.

在VS2010选项 - >调试菜单中,启用“启用.NET Framework源步进”,启用“启用源服务器支持”,禁用“要求源文件与原始版本完全匹配”,按照此处的说明进行操作:(http:// blogs.microsoft.co.il/blogs/arik/archive/2010/07/12/step-into-net-framework-4-0-source-code.aspx)并安装参考源并设置VS以使用参考源中包含的符号文件,以及基于在线文章/博客条目的其他几个尝试。使用该方法,我可以在我的模块窗口中看到正在加载PresentationCore.dll的符号,但是当我尝试进入我正在尝试调试的区域时,我仍然得到“无源可用”窗口。

Modules window showing that Symbols are being loaded from the path where I installed the .NET 4 reference source: Visual Studio 2010  - 无法单步执行.NET Framework 4源代码(PresentationCore.dll)

模块窗口显示从我安装.NET 4参考源的路径加载符号:

Call stack showing that it seems like I should be able to step into PresentationCore.dll's System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage method: Visual Studio 2010  - 无法单步执行.NET Framework 4源代码(PresentationCore.dll)

调用堆栈显示我似乎应该能够进入PresentationCore.dll的System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage方法:

The "No Source Available" window, with "Browse to Find Source" disabled: Visual Studio 2010  - 无法单步执行.NET Framework 4源代码(PresentationCore.dll)

“无源可用”窗口,禁用“浏览到查找源”:

I'm not really sure what else to try?

我不确定还有什么可以尝试的?

1 个解决方案

#1


2  

One possible reason is make sure the .Net assemble is as the same version as set in the project. I had the same problem, because the .Net in project was set to 3.5 and the source code was in 4.5

一个可能的原因是确保.Net汇编与项目中设置的版本相同。我遇到了同样的问题,因为项目中的.Net设置为3.5,源代码设置为4.5

#1


2  

One possible reason is make sure the .Net assemble is as the same version as set in the project. I had the same problem, because the .Net in project was set to 3.5 and the source code was in 4.5

一个可能的原因是确保.Net汇编与项目中设置的版本相同。我遇到了同样的问题,因为项目中的.Net设置为3.5,源代码设置为4.5