How can we help you today? How can we help you today?

Debugging .Net aasemblies like Sytem.Web

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
0

Comments

2 comments

  • Clive Tong
    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
    0
  • jhollz89
    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
    0

Add comment

Please sign in to leave a comment.