. net 原始碼調試

來源:互聯網
上載者:User

標籤:c   style   blog   code   a   http   

 對於 .net framework 中的代碼,光拿 Reflector 看是不夠過癮的,如果能夠調試進去就好了!

其實,微軟是提供了一套 sourcecode 的下載的:

http://referencesource.microsoft.com/netframework.aspx

下載後運行安裝檔案把 source 和 symbols 安裝到本地,這沒啥好說的。

關鍵是下面在 Visual Studio 2010 中的配置:

1. 運行 Visual Studio 2010

2. 從 Tools 菜單中選中 Options 項

3. 在 Options 對話方塊中選擇 Debugging->General

    Uncheck "Enable Just My Code (Managed only)"

    Check "Enable source server support"

    Uncheck "Require source files to exactly match the original version"

    Optional: Uncheck “Step over properties and operators (Managed only)”

4. 選擇 Debugging->Symbols

    在Symbol file(.pdb) locations: 地區, 點擊"建立"按鈕,在新添加的 checkbox 後面輸入剛才安裝的 Symbols 目錄(也就是..\RefSrc\Symbols)。

    設定一個目錄用於緩衝 Symbols。點OK!!

好了,現在你就可以在你的項目中按F11進入 framework 的 sourcecode 了, enjoy it !

如果碰到什麼問題的話,可以參考下面這篇文章中的 Troubleshooting 部分:

http://blogs.microsoft.co.il/blogs/arik/archive/2010/07/12/step-into-net-framework-4-0-source-code.aspx

 

http://weblogs.asp.net/rajbk/setting-up-visual-studio-2010-to-step-into-microsoft-net-source-code

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.