开发者

Visual studio lost current code on sudden crash

开发者 https://www.devze.com 2023-03-11 03:59 出处:网络
My visual studio 2010 crashed when some carelessness [bit of madness] mistakenly pre开发者_StackOverflow社区ssed start button and my Acer timeline got unstable. Two projects where open at the time, on

My visual studio 2010 crashed when some carelessness [bit of madness] mistakenly pre开发者_StackOverflow社区ssed start button and my Acer timeline got unstable. Two projects where open at the time, one in visual studio 2005 [I have both 2005 and 2010 installed]. Unfortunately I lost all the codes I had done at the time along with those coded even weeks before. Now the project files in both the solutions are those weeks older. Amazingly, the .aspx pages are intact and .cs files are gone.

What can be done to get the lost data? Help please.

Thanks.


Guys TAKE CARE if your Visual Studio crashes, you need to check the backup BEFORE you restart Visual Studio and check if your files are ok! Many people complain that they lost work after a crash, and then they restart Visual Studio, and upon discovering that their code cannot be found in Visual Studio they then check the backup at the location

%USERPROFILE%\Documents\Visual Studio 2010\Backup Files\\

The order is important. Check the backup FIRST, before restarting Visual Studio. If you start Visual Studio and then open your old project it's probable that Visual Studio will overwrite the backup files for that project.

Securing the backup is your FIRST concern. Then start Visual Studio and open your project to see how much damage there is.


You can check:

C:\Users\<username>\Documents\Visual Studio 2010\Backup Files\<ProjectName>\
C:\Users\<username>\Documents\Visual Studio 2005\Backup Files\<ProjectName>\

More information can be found here: Visual Studio 2010 AutoRecover Feature


I just had the same experience -- losing a source file during a BSOD. Very annoying!

No backup file could be found, and I searched the hard drive for a file containing the class name, but no backup was unturned.

However I was able to get back something resembling my code by decompiling a DLL from the bin/Debug folder using DotPeek. So if you had previously compiled your code successfully, you can get the code (without comments, and with some weird local variable names, etc) via decompilation.


I Had the same problem, I lost code due to BSOD.

the backup folder should store files not saved until they are saved whenever you save the files there are deleted.

I think that maybe they don't remain after a restart as it was empty in my case.


A very good file recovery tool is Recuva. It helped me once, didn't help me second time, though, because I noticed the data loss too late, and all recoverable data got overwritten.

So I used DotPeek, though you'll have to do a lot of work on the disassembled files, they are pretty weird.

Now I put my source tree in Google Drive, because it has file versions and keeps deleted files. Dropbox would do, too.

Git or any other VCS are not solution for this thing, because you cannot have crazy amount of meaningless commits.

0

精彩评论

暂无评论...
验证码 换一张
取 消