views:

288

answers:

2

Hello.

There is a lot of disassemblers witch allows seeing the internal structure of .NET base assemblies.

Is there a way, add-in or similar for Visual Studio that will permit debugging through the disassembled code?

By example I have a user control I set the Width = 100 but the width always remains to 200. After a half on hour I remarked that the Minimum Size was set to 200. I reset the MinimumSize, but this does not help, With would not to change.

+1  A: 

You don't decompile the code - you tell Visual Studio to use a Microsoft symbol server to get the code from. The most important bit of that page is this:

Microsoft Visual Studio 2008 SP1 connects to the Microsoft public symbol servers automatically when you click Load symbols from Microsoft symbol servers in the Options dialog box (Debugging category, Symbols page) or the shortcut menu (in the Modules Window of Call Stack Window).

Note that you can only press the "Load symbols..." button when you're already debugging - otherwise it's disabled.

You'll need to accept the licence from Microsoft to do this, but it's the right way to do it.

Jon Skeet
@serhio: When you go through the process, it asks you to accept a licence. At least, I believe it does - I'm trying it now :)
Jon Skeet
@Jon: yeah. I should accept a license agreement - no pbs. But... **it asks me for a source file... of UserControl.cs ??!!**
serhio
@serhio: After saying to load symbols from the Microsoft server? That's odd. I'll try to reproduce in a little sandbox.
Jon Skeet
@serhio: Are you seeing *any* of the framework code?
Jon Skeet
I see only the stack calls method names. If I double click on the one of them it says that (i translate from french) there is no code available code for the current line/location...
serhio
@Jon: apparently it search in *"f:\dd\ndp\fx\src\WinForms\Managed\System\WinForms\Control.cs"*, where F should be my CD location.
serhio
That doesn't sound right. I'm afraid I don't know how to do it with vs2005 - I suspect that's the problem.
Jon Skeet
+1  A: 

Check this article: http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx

Alex Reitbort
I do the actions mentionned in that article (for VS 2005). Now, in order to enter in the .NET Assembly VS asks me for a source file... of UserControl.cs ??!!
serhio
just to say that I use VS **2005** not, 2008 and the blog's first step *Install the Visual Studio 2008 QFE** does not impact, apparently VS 2005...
serhio
Check last comment in this blog entry, about .Net Mass Downloader for vs2005 support: http://www.hanselman.com/blog/NETFrameworkLibrarySourceCodeAvailableForViewing.aspx
Alex Reitbort
@Alex, thanks. However http://netmassdownloader.codeplex.com/Thread/View.aspx?ThreadId=78942
serhio
ok, for me, finally, I didn't arrive to see my debug inside .NET framework assemblies code in my 2005 but, however, this is an answer :)
serhio