从Visual Studio文档缓存中恢复文件?

时间:2021-09-30 00:37:53

I've just lost some code. I needed to move a couple of methods from one class to another so i hit save, cut the methods and VS crashed. Now it seems that the save happened after the cut since the code has been saved without those methods but the code isn't on my clipboard. So I'm left without the code and no easy way to get it back!

我刚丢失了一些代码。我需要将一些方法从一个类移动到另一个类,所以我点击保存,切割方法和VS崩溃。现在似乎保存发生在切割之后,因为代码已经保存而没有这些方法,但代码不在我的剪贴板上。所以我没有代码,没有简单的方法来取回它!

I know that Visual Studio keeps a document cache which it uses when the recover files dialog is shown but it wasn't shown when VS started back up. I'm hoping that there is a version of my class with the code still in there so i don't have to start again but i don't know where to look.

我知道Visual Studio保留了一个文档缓存,它在显示恢复文件对话框时使用,但是当VS启动备份时它没有显示。我希望我的班级版本仍然在那里,所以我不必重新开始,但我不知道在哪里看。

Can anybody tell me where VS keeps these files on disk?

任何人都能告诉我VS将这些文件保存在磁盘上的位置吗?

Really appreciate ANY help you can offer.

非常感谢您提供的任何帮助。

6 个解决方案

#1


Sorted it. Those recovery files are located @ MyDocuments\Visual Studio X\Backup Files\Project Name...

对它进行排序。这些恢复文件位于@ MyDocuments \ Visual Studio X \ Backup Files \ Project Name ...

#2


If you have compiled the code into a DLL, then you can use ILSpy, or Reflector to decompile that back into code.

如果您已将代码编译到DLL中,则可以使用ILSpy或Reflector将其反编译回代码。

#3


I came here looking for an answer to the same issue, but none of these things helped -- that being said, in visual studio 2010 deleted files end up in the Windows Recycle bin.

我来到这里寻找同一问题的答案,但这些都没有帮助 - 可以说,在Visual Studio 2010中,已删除的文件最终会出现在Windows回收站中。

Here's another post talking about the same thing: How do I recover a deleted item from Visual Studio 2010?

这是另一篇文章谈论同样的事情:如何从Visual Studio 2010中恢复已删除的项目?

#4


For Linux, the location seems to be ~/.config/Code/Backups/

对于Linux,位置似乎是〜/ .config / Code / Backups /

(found the info here: https://github.com/Microsoft/vscode/issues/3884)

(在这里找到信息:https://github.com/Microsoft/vscode/issues/3884)

Good luck recovering your files, future travellers! I got lucky!

祝你好运,恢复你的文件,未来的旅行者!我很幸运!

#5


It doesn't help you now, but you might want to install ClipX, which helps keep as many items on the clipboard as you'd like. It's helped me in times when the crash happened, but there was a version on the clipboard awhile back.

它现在对你没有帮助,但你可能想要安装ClipX,它可以帮助你在剪贴板上保留尽可能多的项目。崩溃发生时,它帮助了我,但是剪贴板上有一个版本。

#6


This is a known bug in VS and is being continually ignored by Microsoft. I've lost full day's worth of work as a result. The solution that worked for me was to move my project to a GoogleDrive sync folder. Now every time I save files, Google drive syncs a copy to the cloud. Along with regular commits to Git, I should never have to loose work.. sigh

这是VS中的已知错误,并且不断被Microsoft忽略。结果我失去了一整天的工作。对我有用的解决方案是将我的项目移动到GoogleDrive同步文件夹。现在每次保存文件时,Google驱动器都会将副本同步到云端。随着对Git的定期承诺,我永远不应该放松工作..叹息

#1


Sorted it. Those recovery files are located @ MyDocuments\Visual Studio X\Backup Files\Project Name...

对它进行排序。这些恢复文件位于@ MyDocuments \ Visual Studio X \ Backup Files \ Project Name ...

#2


If you have compiled the code into a DLL, then you can use ILSpy, or Reflector to decompile that back into code.

如果您已将代码编译到DLL中,则可以使用ILSpy或Reflector将其反编译回代码。

#3


I came here looking for an answer to the same issue, but none of these things helped -- that being said, in visual studio 2010 deleted files end up in the Windows Recycle bin.

我来到这里寻找同一问题的答案,但这些都没有帮助 - 可以说,在Visual Studio 2010中,已删除的文件最终会出现在Windows回收站中。

Here's another post talking about the same thing: How do I recover a deleted item from Visual Studio 2010?

这是另一篇文章谈论同样的事情:如何从Visual Studio 2010中恢复已删除的项目?

#4


For Linux, the location seems to be ~/.config/Code/Backups/

对于Linux,位置似乎是〜/ .config / Code / Backups /

(found the info here: https://github.com/Microsoft/vscode/issues/3884)

(在这里找到信息:https://github.com/Microsoft/vscode/issues/3884)

Good luck recovering your files, future travellers! I got lucky!

祝你好运,恢复你的文件,未来的旅行者!我很幸运!

#5


It doesn't help you now, but you might want to install ClipX, which helps keep as many items on the clipboard as you'd like. It's helped me in times when the crash happened, but there was a version on the clipboard awhile back.

它现在对你没有帮助,但你可能想要安装ClipX,它可以帮助你在剪贴板上保留尽可能多的项目。崩溃发生时,它帮助了我,但是剪贴板上有一个版本。

#6


This is a known bug in VS and is being continually ignored by Microsoft. I've lost full day's worth of work as a result. The solution that worked for me was to move my project to a GoogleDrive sync folder. Now every time I save files, Google drive syncs a copy to the cloud. Along with regular commits to Git, I should never have to loose work.. sigh

这是VS中的已知错误,并且不断被Microsoft忽略。结果我失去了一整天的工作。对我有用的解决方案是将我的项目移动到GoogleDrive同步文件夹。现在每次保存文件时,Google驱动器都会将副本同步到云端。随着对Git的定期承诺,我永远不应该放松工作..叹息