C# 2010 project not setup correctly

Category: c# ide


scamper_cat on Fri, 06 Jul 2012 02:04:56

I am wondering what configuration settings(s) are incorrect in a C# 2010 setup and deployment project in the following two situations:

1. My goal is to recover some lost C# .net source code files by looking at the setup and deployment project.

Right now when I use decompiler software, I obtain only the *.cs files that are generated by the .net framework. I do not have any *.cs files that were written by people.

One of my options I have setup in my visual studio.net 2010 professional version is to debug code generated by the .net framework and code written by people. Would I need to change my debug options to 'just my code'?

2. I am wondering if I am looking for the wrong type of files and/or possibly looking in the wrong place for the files?

I am looking at the dll files in the bin directoy fo where the C# 2010 application has been deployed to.

Let me know if you have any answer(s) to my question(s).


sendilg on Fri, 06 Jul 2012 08:19:45

There is not issue in the configuration settings, Setup and deployment will not get you any source code.

A set up can be created just from the .Net assembly & there is no need of code.

If you need code you are looking at the wrong place. Decompiling will not get you the actual code developed by your people.

Check the path of the .Net assembly where it has been referenced from & try to find the code. 

scamper_cat on Fri, 06 Jul 2012 13:27:00

Can you tell me exactly what you mean by,

"Check the path of the .Net assembly where it has been referenced from & try to find the code?'

Basically there is the project file call mainapp.

When I open the 'original' code and look in the project folder for mainapp, I see references to this file in the following

1. bin directory. I see mainapp.dll and mainapp.pbd

2. in the obj/release directory, I see  mainapp.dll and mainapp.pbd

3. in the web references section, I see the code for all the modules in the mainapp folder.

I ran the mainapp.dll that was in the obj folder through the justdecompiler and I get the code I am looking for.

Thus from the setup and deployment project can  you tell me how to obtain the the all the code from the mainapp project?

Is there a way to accomplish this goal?

CoolDadTx on Fri, 06 Jul 2012 14:18:34

The setup project is just a binary EXE with the assemblies as content.  What Scamper_cat is saying is that by itself it doesn't give you anything.  What you need to do is extract your assemblies from the setup program.  Once you have your assemblies then you can use a disassembler to get back to a semblance of the code but you won't be able to get back to the actual code.

Extracting the files from a setup program can be difficult.  If you have the EXE then you'll need to use a tool like Orca to extract the files (which are mangled).  If you have the MSI then you can use something like 7-Zip to get to the actual files.  I tried using 7-zip on the EXE but it didn't display the files (but I didn't try too hard either).

Michael Taylor - 7/6/2012