How to recover source code from a dll that's compiled in debug release

Discussion in 'ASP .Net' started by C.W., Apr 11, 2006.

  1. C.W.

    C.W. Guest

    I lost my laptop as well as my backup server. I am wondering if there is a
    way to step through the code without the source code, but only with the dll
    and pdb (which are compiled in debug mode) through vs.studio at all? I do
    have these files as they are stored on a remote site for testing.

    Any idea? thanks in advance.

    CW
     
    C.W., Apr 11, 2006
    #1
    1. Advertising

  2. No. If you want to source, you could try reverse engineering the assemblies
    using tools like Reflector, but that will not give you the exact code that
    was used to compile with, only an interpretation since the compiler does
    optimization and stuff.


    "C.W." <> wrote in message
    news:%...
    >I lost my laptop as well as my backup server. I am wondering if there is a
    >way to step through the code without the source code, but only with the dll
    >and pdb (which are compiled in debug mode) through vs.studio at all? I do
    >have these files as they are stored on a remote site for testing.
    >
    > Any idea? thanks in advance.
    >
    > CW
    >
     
    Peter Rilling, Apr 11, 2006
    #2
    1. Advertising

  3. C.W.

    C.W. Guest

    Hi Peter

    I wonder how then asp.net is able to return error messages with exact line
    number and the code on that line whenever it encounters an error. It must
    somehow stores the data somewhere. Anyway to get to that? I know it doesn't
    store comment, but it does seem that it stores source code, nevertheles.

    Thanks

    CW

    "Peter Rilling" <> wrote in message
    news:uZ3Ly$...
    > No. If you want to source, you could try reverse engineering the
    > assemblies using tools like Reflector, but that will not give you the
    > exact code that was used to compile with, only an interpretation since the
    > compiler does optimization and stuff.
    >
    >
    > "C.W." <> wrote in message
    > news:%...
    >>I lost my laptop as well as my backup server. I am wondering if there is a
    >>way to step through the code without the source code, but only with the
    >>dll and pdb (which are compiled in debug mode) through vs.studio at all? I
    >>do have these files as they are stored on a remote site for testing.
    >>
    >> Any idea? thanks in advance.
    >>
    >> CW
    >>

    >
    >
     
    C.W., Apr 11, 2006
    #3
  4. C.W.

    David Hogue Guest

    Re: How to recover source code from a dll that's compiled in debugrelease

    Hi CW,

    My understanding of how asp.net displays the source is this:
    1. asp.net catches an exception and gets a stack trace
    2. the stack trace includes source file names and line numbers
    3. asp.net opens the source file pointed to by the stack trace

    I've noticed before that if I move the source or edit it, but don't
    recompile asp.net will display the edited source.

    I think the best you're going to be able to do is use Reflector to get
    the code.

    -David


    C.W. wrote:
    > Hi Peter
    >
    > I wonder how then asp.net is able to return error messages with exact line
    > number and the code on that line whenever it encounters an error. It must
    > somehow stores the data somewhere. Anyway to get to that? I know it doesn't
    > store comment, but it does seem that it stores source code, nevertheles.
    >
    > Thanks
    >
    > CW
    >
     
    David Hogue, Apr 11, 2006
    #4
  5. C.W.

    Jason Hales Guest

    FYI, ASP.NET (and also WinForms) will only return error line numbers if
    your application includes the program debug file (PDB) - which a Debug
    build will do

    You can configure the Release build to generate a debug file (which it
    doesn't by default) under Config Properties | Build | Generate
    Debugging Info

    Hope that helps a bit
     
    Jason Hales, Apr 11, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    645
  2. Maellic

    recover .vb source code in ASP .NET

    Maellic, Feb 23, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    698
    Tommy
    Feb 23, 2004
  3. Mike

    recover source from DLL?

    Mike, Apr 7, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    2,450
  4. Klaus Schneider
    Replies:
    1
    Views:
    551
    Rolf Magnus
    Dec 2, 2004
  5. lander
    Replies:
    5
    Views:
    597
    bruce barker
    Mar 5, 2008
Loading...

Share This Page