Alex Rivera | Logout

Visual studio 2010 empties the file on crash

Asked 2011-07-01T17:38:37.610
11

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.

Edit
Report

3 Answers

1

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.

answered 2012-06-22T00:51:53.773
0

Save often and use source control. I use C.V.S., personally.

It sounds like the I.D.E. had the file(s) open for writing at byte 0 when the computer went down, clearing everything out.

Beyond your software problems, I suggest you manage your power plug in such a way that it won't be accidentally switched off.

answered 2011-07-01T17:47:50.200
0

Same thing happened to me and thought I would post it here for those who would come here for answers.

If you have compiled and built the code at least once, you can reverse engineer the binary. Reflector did the trick for me.

answered 2012-03-18T21:02:10.220

Your Answer