Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2010 empties the file on crash

I got a really bad problem while working on visual studio 2010. Accidently the power plug switched off and when I started the computer again the file was completly empty. I tried out following things:

  • I opened it in notepad and other couple of editors and it was empty.

  • I then opened it in Hex Editor. Hex editor shows that all bytes are set to 0.

  • I programatically read the file and it also showd all bytes set to 0.

  • Checked "Documents\Visual Studio 2010\Backup Files\" for my project and it was empty.

The file size is still showing in KBs but the code is completly gone.

Is there any possible way by which I can recover my code? If there is not, can anyone suggest me a setting/patch taht should be there so that it never happens again.

Note: I already have Autorecover option set for every 5 minutes in IDE.

Update: As suggested by Henok, If you have compiled and built the code at least once, you can reverse engineer the binary through reflector.

like image 312
ZeNo Avatar asked Jul 01 '11 17:07

ZeNo


2 Answers

Doesn't look like it, to stop in future though, save and save often. Also look at using subversion like svn, or Git.

like image 52
Jethro Avatar answered Nov 09 '22 23:11

Jethro


IIS has DLLs cached under C:\Windows\Microsoft.NET\v4.0.xyz\Temporary ASP.NET Files. Look for the dll and use a reflector. I use ILSpy.

like image 44
midnightsky Avatar answered Nov 09 '22 22:11

midnightsky