views:

80

answers:

2

I have an EXE that is currently deployed on our production server (c# .net 2). I have inherited the task of making some changes to this app and re-deploying.

I didn't write this app and I have been pointed at a few different folders on various network drives with a few different Visual Studio solutions (~10) that were various incantations of this app through time and could be contenders for the Visual Studio project that was used to generate this exe but I don't know which project was used that matches the in production EXE.

Is there a way using .net Reflector or another tool to determine the original file path the source files lay when they were used to compile the EXE, I can then work backwards to determine the correct Visual Studio solution and start making changes there.

Thanks

A: 

Your best bet is probably to use Reflector & one of the file generator plugins at http://www.codeplex.com/reflectoraddins to dump the code into files. Before making any changes though, make sure you can rebuild.

statichippo
+5  A: 

That sounds like one hell of a situation if you can't get to know what's the origin of what's in running in production.

Nonetheless, one possible solution is to have a look at the debug header of the .exe assembly, if it has been compiled with debug symbols, it may contain the original full path of the pdb, giving you a clue of where it has been built. You can get it with the dumpbin tool that is part of the windows sdk.

Here's an example of the output:

  Debug Directories

        Time Type       Size      RVA  Pointer
    -------- ------ -------- -------- --------
    4A0F2A94 cv           51 0006672C    6492C    Format: RSDS, {77468AA8-8494-46AC-87DF-422721517504}, 8, C:\sources\mcs\class\Mono.Cecil\obj\Debug\Mono.Cecil.pdb

Better yet, if you have the pdb handy, you can use a tool like pdbdump to know which files were used to compile the assembly.

Jb Evain
Awesome, great tip there! dumpbin worked a treat :-) thank you very much.
m3ntat