Aqeel Abbas
Aqeel Abbas

Reputation: 169

MS VS 2012. my code is not showing up (C#)

I am working on a project and while compiling, my laptop handed up and I have to turn it off manually.

After the restart I found that my code is not showing up. There is no line of code in program.cs file.

I am working on that code since a month. And all of it vanished.

Need help. I have the executable file working properly. But i need the code. Is there any way to find that code ?

Upvotes: 0

Views: 72

Answers (2)

Polyfun
Polyfun

Reputation: 9639

Use ILSpy to decompile your executable. You will get the source code back, minus the comments. This is possible because assemblies (like your exe) actually contain "Intermediate Language" (IL), and not native machine code/assembler. From the IL it is possible to get a reasonable representation of the original source code. You may need to recreate the csproj file manually, if you do not have it.

Upvotes: 2

08Dc91wk
08Dc91wk

Reputation: 4318

If you have the .exe you must have compiled it, if you compiled it you must have saved it.

Where it is depends on where you saved it. Easiest thing would be to use the search function in Windows – search for whatever you called your program, or failing that, *.csproj. Then you can open the csproj file with Visual Studio and you should get most of it back.

Upvotes: 0

Related Questions