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

C

C.W.

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
 
P

Peter Rilling

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

C.W.

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
 
D

David Hogue

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
 
J

Jason Hales

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top