Debugging .Net aasemblies like Sytem.Web

Explore, browse and analyze .NET assemblies

Moderators: Luke Jefferson, Charles Brown, StephenC, Alex.Davies, Greg.Tillman, melvyn.harbour

Debugging .Net aasemblies like Sytem.Web

Postby jhollz89 » Tue Mar 01, 2011 4:15 pm

I am tring to debug the following statement
string temp2 = (string)HttpContext.GetLocalResourceObject("~/Samples/Samples/Index.aspx", "ButtonsTest");

It will step into the code for Controller and ControllerContext but NOT the HttpContext.GetLocalResourceObject method where I have a breakpoint setup.

What is the trick to get .Net Reflector Pro to debug this. I am a newbie with this product.
jhollz89
 
Posts: 2
Joined: Tue Mar 01, 2011 4:01 pm

Postby Clive Tong » Wed Mar 02, 2011 4:53 pm

Hi. Sorry for the delay in replying.

For a simple test case that I have set up, stepping in to HttpContext.GetLocalResourceObject stops at the static Create method on VirtualPath.

I set a breakpoint on the GetLocalResourceObject by having the VirtualPath.cs file selected in VS and going File/Open/File. I then navigated to the HttpContext.cs file and put a breakpoint on the two static methods.

Looking in Debug/Windows/Modules for System.Web, you can see that the assembly is optimised. This means that some debuggability is lost. You can use ngen to regenerate the assembly with debugging enabled. You do this by putting an ini file next to the assembly and using ngen to regenerate it. There are a couple of forum posts that mention doing this.

Does that help?
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm

Postby jhollz89 » Wed Mar 02, 2011 7:57 pm

Thanks I was able to get to the debug point after I set checkbox to off for
"Search the above locations only when symbols are loaded manually"
but it is weird because I did not have to do that with System.web.mvc only System.Web maybe a little bug or I was doing somehting else wrong.

But thank you for the note on optimization, I will seach the forum for that.
jhollz89
 
Posts: 2
Joined: Tue Mar 01, 2011 4:01 pm


Return to .Net Reflector 6.x and .NET Reflector 6.x Pro

Who is online

Users browsing this forum: No registered users and 0 guests