0

I have been programming an ASP.NET Core application for the last couples of weeks. Just a "small project" to put on my resume so I can get my first job. But today when I tried to upload it to Github I somehow deleted all the .cs files which really suck big time! However, I still have the files from the bin/debug folder in the original folder where all the .cs files was. Is there any way to restore the .cs files? I have been trying to use .NET Reflector but without any luck because I don't know how it works.

I don't know what information is relevant to know, so please feel free to ask for more details!

Best Regards Christian

Christian
  • 75
  • 1
  • 6
  • 1
    If its only those .cs files (classes) then You can use DotPeek to extract from your .dll assemblies you still have. https://www.jetbrains.com/decompiler/ Open that assembly using dotpeek and extract the content of the class, create another project and paste and make it there. – N Subedi Nov 04 '19 at 17:53
  • 1
    [dotPeek is free](https://www.jetbrains.com/decompiler/) - open the compiled DLL and see what you get. – stuartd Nov 04 '19 at 17:54
  • Why don't you do data recovery on your hard drive – Evik Ghazarian Nov 04 '19 at 17:59
  • Because of a small SSD hard drive I have turned off data recovery which is painful to admit right now... – Christian Nov 04 '19 at 19:11
  • 1
    Another thing to learn from this is to add code to source control as soon as you start on it. – stuartd Nov 05 '19 at 10:56

1 Answers1

1

ILSpy might be easier to use. Just load the binary and it will decompile each type. You can just copy-paste the code.

Claudiu Guiman
  • 837
  • 5
  • 18
  • It was far more easy, thank you so much!!! I have all the .cs files now which is much better than nothing. But it would be nice if I could restore my .cshtml files and my .js file as well? Is that possible somehow? And thank you again! – Christian Nov 04 '19 at 19:05
  • 1
    Those files are not stored in any assembly, they usually sit one folder higher relative to bin/, so probably you lost them - file recovery software might help you here – Claudiu Guiman Nov 04 '19 at 19:11