amir_saniyan
یک شنبه 12 اردیبهشت 1389, 16:00 عصر
SETUP
In VS 2010 RTM, go to Tools –> Options –> Debugging –> General. Check “Enable .NET Framework source stepping”
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_2C464B69.png (http://weblogs.ASP.NET/blogs/rajbk/image_44996584.png)
We get the following dialog box
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_71126F9D.png (http://weblogs.ASP.NET/blogs/rajbk/image_18B8EBC8.png)
This automatically disables “Enable My Code”
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_1B31F7B9.png (http://weblogs.ASP.NET/blogs/rajbk/image_6267C3B8.png)
Go to Debugging –> Symbols and Check “Microsoft Symbol Servers”. You can selectively exclude modules if you want to.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_3B1D54B6.png (http://weblogs.ASP.NET/blogs/rajbk/image_44C5C2EC.png)
You will get a warning dialog like so:
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_069C826E.png (http://weblogs.ASP.NET/blogs/rajbk/image_47AB01D2.png)
Hitting OK will start the download process
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_374F8A19.png (http://weblogs.ASP.NET/blogs/rajbk/image_53CC7BF9.png)
The setup is complete. You are now ready to start debugging!
DEBUGGING
Add a break point to your application and run the application in debug mode (F5 shortcut for me). Go to your call stack when you hit the break point. Right click on a frame that is grayed out.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_7019BE19.png (http://weblogs.ASP.NET/blogs/rajbk/image_5DB16D64.png)
Select “Load Symbols from” “Microsoft Symbol Servers”. VS will begin a one time download of that assembly. This assembly will be cached locally so you don’t have to wait for the download the next time you debug the app.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_4511AA47.png (http://weblogs.ASP.NET/blogs/rajbk/image_0F5C64ED.png)
We get a one time license agreement dialog box
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_7C0B8880.png (http://weblogs.ASP.NET/blogs/rajbk/image_2AD14123.png)
You might see an error like the one below regarding different encoding (hopefully will be fixed).
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_13568CF2.png (http://weblogs.ASP.NET/blogs/rajbk/image_2920754F.png)
Assemblies for which the symbols have been loaded are no longer grayed out. Double clicking on any entry in the call stack should now directly take you to the source code for that assembly.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_7C6795A8.png (http://weblogs.ASP.NET/blogs/rajbk/image_0B5EEA90.png)
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_72BF2772.png (http://weblogs.ASP.NET/blogs/rajbk/image_427852BC.png)
AFAIK, not all symbols are available on the MS symbol server. In cases like that you will see a tab like the one below and be given the option to “Show Disassembly”.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_4A40455E.png (http://weblogs.ASP.NET/blogs/rajbk/image_18B4D7C9.png)
Enjoy!
منبع:
http://weblogs.ASP.NET/rajbk/archive/2010/04/21/setting-up-visual-studio-2010-to-step-into-microsoft-net-source-code.aspx
In VS 2010 RTM, go to Tools –> Options –> Debugging –> General. Check “Enable .NET Framework source stepping”
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_2C464B69.png (http://weblogs.ASP.NET/blogs/rajbk/image_44996584.png)
We get the following dialog box
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_71126F9D.png (http://weblogs.ASP.NET/blogs/rajbk/image_18B8EBC8.png)
This automatically disables “Enable My Code”
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_1B31F7B9.png (http://weblogs.ASP.NET/blogs/rajbk/image_6267C3B8.png)
Go to Debugging –> Symbols and Check “Microsoft Symbol Servers”. You can selectively exclude modules if you want to.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_3B1D54B6.png (http://weblogs.ASP.NET/blogs/rajbk/image_44C5C2EC.png)
You will get a warning dialog like so:
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_069C826E.png (http://weblogs.ASP.NET/blogs/rajbk/image_47AB01D2.png)
Hitting OK will start the download process
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_374F8A19.png (http://weblogs.ASP.NET/blogs/rajbk/image_53CC7BF9.png)
The setup is complete. You are now ready to start debugging!
DEBUGGING
Add a break point to your application and run the application in debug mode (F5 shortcut for me). Go to your call stack when you hit the break point. Right click on a frame that is grayed out.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_7019BE19.png (http://weblogs.ASP.NET/blogs/rajbk/image_5DB16D64.png)
Select “Load Symbols from” “Microsoft Symbol Servers”. VS will begin a one time download of that assembly. This assembly will be cached locally so you don’t have to wait for the download the next time you debug the app.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_4511AA47.png (http://weblogs.ASP.NET/blogs/rajbk/image_0F5C64ED.png)
We get a one time license agreement dialog box
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_7C0B8880.png (http://weblogs.ASP.NET/blogs/rajbk/image_2AD14123.png)
You might see an error like the one below regarding different encoding (hopefully will be fixed).
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_13568CF2.png (http://weblogs.ASP.NET/blogs/rajbk/image_2920754F.png)
Assemblies for which the symbols have been loaded are no longer grayed out. Double clicking on any entry in the call stack should now directly take you to the source code for that assembly.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_7C6795A8.png (http://weblogs.ASP.NET/blogs/rajbk/image_0B5EEA90.png)
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_72BF2772.png (http://weblogs.ASP.NET/blogs/rajbk/image_427852BC.png)
AFAIK, not all symbols are available on the MS symbol server. In cases like that you will see a tab like the one below and be given the option to “Show Disassembly”.
http://weblogs.ASP.NET/blogs/rajbk/image_thumb_4A40455E.png (http://weblogs.ASP.NET/blogs/rajbk/image_18B4D7C9.png)
Enjoy!
منبع:
http://weblogs.ASP.NET/rajbk/archive/2010/04/21/setting-up-visual-studio-2010-to-step-into-microsoft-net-source-code.aspx