Is it possible to debug an assembly loaded in a ASP.NET application? I have neither the source of the DLL nor the source for the ASP.NET project. All I can do is attach to the w3wp.exe process.
Jericho
0

Comments

5 comments

  • Clive Tong
    Yes it is possible.

    When the debugger is attached to an application, say to w3wp.exe after "Attach to process", using the "Choose assemblies to debug" option will allow you to generate debugging information for assemblies that are used. We adjust the symbol search path so that Visual Studio will find and use this debugging information in the subsequent debugging session.

    This all becomes more complicated if the assembly you want to debug doesn't have a debugger signature. This signature is information contained in the headers that debuggers use to link the pdb and the assembly. We have a process that we call "regeneration" which rebuilds an assembly to add the necessary signature and gives you a new assembly. When you have a project, we offer the chance of automatically substituing references to this new assembly, but in this case you would need to get this new assembly loaded instead of the original.
    Clive Tong
    0
  • Jericho
    This "regeneration" convept sounds like what I need however I can't find any reference to it in the interface and I also searched the help section on your web site and can't find any mention of it.

    Can you help me how to "regenerate" the DLL so I can manually copy it in the 'bin' folder of the ASP.NET application?
    Jericho
    0
  • Clive Tong
    The system will do this regeneration if you select an assembly without a debugger signature in the "choose assemblies to debug..." dialog.

    You should just attach to the w3wp.exe and then try to select the assembly you are interested in for debugging.
    Clive Tong
    0
  • Jericho
    and where can I find the DLL the was automatically generated with the proper header? I want to copy it to the 'bin' folder so that it gets loaded by the ASP.NET application as you suggested.
    Jericho
    0
  • Clive Tong
    In the normal case, all you need to do is to attach Visual Studio to the w3wp.exe and use the "Choose assemblies to debug" menu item to select the assembly that you wish to debug.

    Try that. If regeneration is needed, you'd be prompted after that dialog.
    Clive Tong
    0

Add comment

Please sign in to leave a comment.