不能进入.NET框架的源代码 [英] Cannot step into .NET framework source code

查看:133
本文介绍了不能进入.NET框架的源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Visual Studio 2013,并有一个.NET 4.5.2项目。我已按照以下页面设置我的设置:

I am using Visual Studio 2013 and have a .NET 4.5.2 project. I have setup my settings according to following page:

http://referencesource.microsoft.com/setup.html

使用此设置,我可以看到所有必需的符号都已下载并加载,但我无法进入如下代码:

With this setup, I can see that all necessary symbols are downloaded and loaded but I cannot step into a code like the following:

var cookieContainer = new System.Net.CookieContainer();

我正在获得源不可用消息。

我可以直接进入以下代码:

I can step into the following code just fine:

Console.WriteLine("test");

你有什么想法为什么我可以从mscorlib.dll进入代码,但不能进入代码System.dll?

Do you have any idea why I can step into code from mscorlib.dll but cannot step into code from System.dll?

推荐答案


并有一个.NET 4.5.2项目

and have a .NET 4.5.2 project

版本号是你的问题。参考资料来源是一个普遍的问题,Microsoft不能保持更新,足以为新的框架版本提供源代码。更麻烦,更安全和更稳定。工作的人们很清楚这个问题,他们认为这是他们的演讲中的一个问题,但它目前并且总是有一个// todo项目的状态。

The version number is your problem. It is a general problem with the Reference Source, Microsoft does not keep it updated well enough to supply source for new framework versions. And more troubling, for security and stability updates. The guys that worked on this are well aware of this problem, they noted this as an issue in their presentation but it has currently, and always had, the status of a // todo item.

这是您可以可视化的内容,首先从您的符号缓存(MicrosoftPublicSymbols中缓存)中删除System.pdb。然后开始调试测试程序,调试器将从服务器检索一个新的PDB。使用Debug> Windows> Modules,右键单击System.dll并选择Symbol Load Information。在我的机器上看起来像:

It is something you can visualize, first delete System.pdb from your symbol cache (the one in MicrosoftPublicSymbols). Then start debugging your test program, the debugger will retrieve a new PDB from the server. Use Debug > Windows > Modules, right-click System.dll and select "Symbol Load Information". On my machine that looks like:

C:\projects2\ConsoleApplication407\bin\Debug\System.pdb: Cannot find or open the PDB file.
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.pdb: Cannot find or open the PDB file.
C:\Windows\System.pdb: Cannot find or open the PDB file.
C:\Windows\symbols\dll\System.pdb: Cannot find or open the PDB file.
C:\Windows\dll\System.pdb: Cannot find or open the PDB file.
C:\temp\symbols\System.pdb\c464b02c2bf04080adcad166dc729c151\System.pdb: Cannot find or open the PDB file.
C:\temp\symbols\MicrosoftPublicSymbols\System.pdb\c464b02c2bf04080adcad166dc729c151\System.pdb: Cannot find or open the PDB file.
SYMSRV:  C:\temp\symbols\System.pdb\C464B02C2BF04080ADCAD166DC729C151\System.pdb not found
SYMSRV:  http://referencesource.microsoft.com/symbols/System.pdb/C464B02C2BF04080ADCAD166DC729C151/System.pdb not found
http://referencesource.microsoft.com/symbols: Symbols not found on symbol server.
SYMSRV:  System.pdb from http://msdl.microsoft.com/download/symbols: 96985 bytes 
http://msdl.microsoft.com/download/symbols: Symbols downloaded from symbol server.
C:\temp\symbols\System.pdb\C464B02C2BF04080ADCAD166DC729C151\System.pdb: Symbols loaded.

您可以看到它在正常位置搜索PDB,而不是找到它。然后联系SYMSRV。它首先进入 http://referencesource.microsoft.com ,因为它应该,但该服务器说没有找到。而您将从常规msdl服务器获取副本,该文件没有必要的文件+行号调试信息。

You can see it searching for the PDB in the normal locations and not finding it. Then contacting the SYMSRV. It first goes to http://referencesource.microsoft.com, as it should, but that server says "not found". And you'll get the copy from the regular msdl server, the stripped one that doesn't have the necessary file + line number debugging info.

没有干净的修复为此,您必须将机器重新降级为参考源版本。我不能做的,使用Windows 8.1。而不应该做,我用VS2013。 Redgate的反射器是一种替代方案。

There is no clean fix for this, you'd have to downgrade your machine again to the reference source version. Something I cannot do, using Windows 8.1. And should not do, I use VS2013. Redgate's Reflector is an alternative.

我创建了一个 UserVoice项目,它需要更多的投票。

I created a UserVoice item for this, it needs a lot more votes.

更新:参考源现在更新为4.5.2(2015年3月)

Update: the Reference Source is now updated to 4.5.2 (March 2015)

这篇关于不能进入.NET框架的源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆