Visual Studio使用已下载的微软.NET源代码

前几天看到园子里有位仁兄告之使用NetMassDownloader下载.NET源代码(原帖在这里:http://www.cnblogs.com/shanyou/archive/2008/02/15/netmassdownloader.html),于是也尝试了一下,果真把Source都下了下来,可是该怎么使用,网上倒是有不少线程的教程,虽然都是E文,但是很简单。

To use the .NET Reference Source with Visual Studio 2005/2008, you would need to do the following three additional steps. The first is in the Options dialog for Visual Studio, Debugging, Symbols property page. In the “Symbol file (.pdb) locations” list box, you would add “c:\ReferenceSource” like the following.


The second setting is in Options dialog, Debugging, General property page, uncheck Require source files to exactly match the original version.(注意:这里如果已经下载源代码到本地了,就应该把Enable source server support选项不选中,这样可以加快debug时的检索速度)


The final step you’ll have to do in each solution where you want to access the downloaded .NET Reference Source Code, you’ll go into the solution property pages, Common Properties, Debugging Source Files, and add C:\ReferenceSources to the top of the “Directories containing source code” list box as follows:

Visual Studio 2005/2008 will automatically do the right thing and replace the first directory of every source file it finds in a PDB file with c:"ReferenceSource. With the automation model in Visual Studio 2005/2008, I’m sure you could wipe up a macro to automatically set that path in the solution.

这个方法可以使用,但是略显麻烦。经过一段业余时间研究,发现有个容易的办法:
第一和第二个设置没得说,就那么设置就可以了。第三条设置可以通过修改注册表,简化操作。
如果你的IDE是VS2005:
在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0下面有一个Key叫Source Directories,把你的本地源代码路径添到最前并以分号(;)结尾即可。
如果你的IDE是VS2008,那么这个注册表位置在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0,其他一样。
完成之后,你只需要把工程文件所在目录的*.suo文件(suo文件是工程文件的配置缓存文件,起加速载入作用,删除之后打开工程IDE会自动创建新的缓存)删除即可。

另外,Colin告诉我,如果你的系统是Vista并且硬盘有个分区叫F,那么你还可以通过创建文件夹link来建立快捷使用方式:

mklink -d f:\redbits c:\ReferenceSource\redbits

update at 2008/02/20 13:40:
1、感谢Colin指出错误,已更正。
2、感谢shanyou的补充说明——Source Reference需要你自己同意MS-PL协议才能看代码的,所以别人是不能通过邮件方式给你发送的
3、本文仅适用于已经下载了Source。
4、请注重版权和授权。

 


To be the apostrophe which changed “Impossible” into “I’m possible”
----------------------------------------------------
WinkingZhang's Blog (http://winkingzhang.cnblogs.com)
GCDN Community (http://gcdn.grapecity.com/cs)
Tag标签: Debug,.NET
posted @ 2008-02-20 11:46 winkingzhang 阅读(4045) 评论(14)  编辑 收藏 网摘

  回复  引用  查看    
#1楼 2008-02-20 12:50 | 针式个人知识库管理      
能不能将源代码共享或发一份给我:fjwuyonghiz@gmail.com 先谢了
  回复  引用  查看    
#2楼 2008-02-20 13:14 | Colin Han      
哈哈,最后的命令行写反了。 应该是:
mklike -d f:\redbits c:\ReferenceSource\redbits
@针式个人知识库管理
需要你自己同意MS-PL协议才能看代码的,所以别人是不能通过邮件方式给你发送的
  回复  引用    
#4楼 2008-02-20 13:16 | pwg [未注册用户]
设置完了又怎么下载呢。。?
不太明白..
能说明一下么。。?
  回复  引用  查看    
#5楼 2008-02-20 13:28 | rockshit      
www.codeplex.com有介绍使用方法
  回复  引用  查看    
#6楼 2008-02-20 14:10 | 无常      
有没有下载好的压缩包?
我用NetMassDownloader每次都下不完就断了
  回复  引用  查看    
#7楼 2008-02-20 14:12 | netguid      
能不能共享一下你下载的源码啊,这样我们就直接用就是了
  回复  引用    
#8楼 2008-02-20 16:00 | A.Z! [未注册用户]
NetMassDownloader的源码今天草草看了一下,感觉不太成熟,里面有true/false == boolean这样的代码...实在不能说作者很高明,其实获取源码的步骤还是比较简单的,里面大量的代码堆积在支持不用的参数的分析上。

我觉得应该做成win app的程序,这样的UI更加的友善,毕竟批量的下载是一个长任务的作业,需要信息的反馈。可以把什么从注册表读IDE配置的去掉,最好可以部署在没有IDE的机器上。


谁来改进一下?

  回复  引用  查看    
#9楼 2008-02-20 17:53 | 费哥      
不知道源码主要开放了哪些内容
  回复  引用  查看    
#10楼 2008-02-20 19:53 | sunbird69      
下载过程中 好象有许多文件都 是无法下载的
  回复  引用    
#11楼 2008-02-21 09:38 | imxjb [未注册用户]
嗯,这个介绍很重要,收藏
  回复  引用    
#12楼 2008-02-21 13:13 | HappyQQ520 [未注册用户]
为什么我昨天晚上用这个工具下载却下载不了?

是不是我网速的原因了?
  回复  引用  查看    
#13楼 2008-02-24 20:20 | 守護~︶箬      
我也下载不了啊!
真的需要楼主共享一下代码
  回复  引用    
#14楼 2008-03-24 04:39 | Kerem Kusmezer [未注册用户]
@A.Z!

Hi My Friend,

The null == object stuff is the way prefered by John, and seems to be his habit,
we planned in the beginning actually a wingui version, but a commandline version seems to be more usefull.

If you want a win version, just send me the features you want in the winapp version, so i can deliver it in 1 - 2 days in the project page if you want.


标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-02-20 13:53 编辑过
"五向定位"职业成长路线公开课(上海、南京、大连)
Google站内搜索


相关链接: