visual-studio 恢复从未保存的 Visual Studio 项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3533431/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:21:56  来源:igfitidea点击:

Recover a Visual Studio project that was never saved

visual-studio

提问by poke

I started a new project this morning and, after putting ~3 hours of work into it, I tried to open a file from another project to get some code from it. I got a warning about discarding an unsaved object. After telling it to go ahead, I realized that it was referring to the project I had just been working on and not another file that I had just opened.

今天早上我开始了一个新项目,在投入了大约 3 个小时的工作之后,我尝试打开另一个项目中的文件以从中获取一些代码。我收到有关丢弃未保存对象的警告。在告诉它继续之后,我意识到它指的是我刚刚处理的项目,而不是我刚刚打开的另一个文件。

Even though I never saved the project, the various files containing my code and dataset had to exist on the hard-drive. Are they still there, perhaps in a temp folder? I'm developing on a box running Server 2008 R2 (don't ask, not my decision :) ).

即使我从未保存过该项目,包含我的代码和数据集的各种文件也必须存在于硬盘上。它们还在吗,也许在临时文件夹中?我正在运行 Server 2008 R2 的机器上开发(不要问,不是我的决定:))。

回答by Shawn

This may help: http://blogs.msdn.com/b/saraford/archive/2008/02/14/did-you-know-where-visual-studio-saves-auto-recovered-files-in-the-case-of-an-unexpected-shutdown-151.aspx

这可能会有所帮助:http: //blogs.msdn.com/b/saraford/archive/2008/02/14/did-you-know-where-visual-studio-saves-auto-recovered-files-in-the- case-of-an-unexpected-shutdown-151.aspx

Also check C:\Users{Username}\AppData\Local\Temporary Projects

还要检查 C:\Users{Username}\AppData\Local\Temporary Projects

You could try one of those undelete programs and see if it finds anything.

您可以尝试其中一个取消删除程序,看看它是否找到了任何东西。

Tools > Options > Projects and Solutions

工具 > 选项 > 项目和解决方案

and check the item

并检查项目

Save new projects when created

创建时保存新项目

Save frequently. :)

经常保存。:)

回答by Colnaghi

Need to give one related input. Who the hell had the idea to implement this feature???

需要给出一个相关的输入。谁他妈的有想法来实现这个功能???

I used Visual Studio until 2003, then came back again to 2010 now. After 2 days work, saving all the time, as I used to (Ctrl + S), I close the project and decide not to save the solution itself.

我一直使用 Visual Studio 直到 2003 年,然后现在又回到了 2010 年。经过 2 天的工作,一直在节省时间,就像我过去所做的那样 ( Ctrl + S),我关闭了项目并决定不保存解决方案本身

Done. All lost. Nothing can be recovered from anywhere in the computer.

完毕。都输了。从计算机的任何位置都无法恢复任何内容。

How can a developer implement a dumb idea such as dropping all work in an "in memory" project. You either know about it already or you will get screwed; like thousands found on Google during my desperate search.

开发人员如何实现一个愚蠢的想法,例如将所有工作放在“内存中”项目中。你要么已经知道,要么就会被搞砸;就像在我绝望的搜索过程中在 Google 上找到的数千一样。

Did Microsoft VS team look at it at least? So frustrating...

微软VS团队至少看过吗?好郁闷...

回答by DOK

It might be worth checking out the folder where AutoRecover files are saved.

可能值得检查保存自动恢复文件的文件夹。

You can find the default file location in Visual Studio on the Tools - Options menu. Look in the Projects and Solutions section - expand that and look in General to find the default file locations.

您可以在 Visual Studio 中的工具 - 选项菜单上找到默认文件位置。查看“项目和解决方案”部分 - 展开该部分并查看“常规”以查找默认文件位置。

My files were under C:\My Documents\Visual Studio 2008\Backup Files.

我的文件在 C:\My Documents\Visual Studio 2008\Backup Files.

回答by Steve DeVries

I had this happen to me this morning. I worked on a new project yesterday and windows ran an update last night. Despite having debugged my program - the project had not saved - for some reason it didn't occur to me that the project might not be saved. I left the program running on my computer when I went to bed. This morning when I work up, I saw that windows had run an update. A few hours later, I saw that my computer had no trace of my program. I realize this is an old post, but I thought I would shed some light on what I did, since i was able to recover my files.

今天早上我遇到了这种情况。我昨天做了一个新项目,昨晚 Windows 运行了更新。尽管调试了我的程序 - 该项目没有保存 - 由于某种原因,我没有想到该项目可能不会被保存。我睡觉时让程序在我的电脑上运行。今天早上,当我工作时,我看到 Windows 运行了一个更新。几个小时后,我看到我的电脑没有我的程序的踪迹。我意识到这是一个旧帖子,但我想我会阐明我所做的事情,因为我能够恢复我的文件。

First I went here: http://windows.microsoft.com/en-us/windows7/recover-lost-or-deleted-files

首先我去了这里:http: //windows.microsoft.com/en-us/windows7/recover-lost-or-deleted-files

In Visual Basic 2010 Express, a backup folder is created with your project name. Sure enough, my project backckup folder was there: Documents\Visual Studio 2010\Backup Files\MyProject. But, the folder was empty. I "restored this folder to a previous version" using the steps listed in the link above. After doing that, the folder was still empty, BUT, the temporary folder "C:\Users{Username}\AppData\Local\Temporary Projects" now contained my project's folder and files. Prior to running the "restore to previous version", the temporary projects folder was also empty.

在 Visual Basic 2010 Express 中,使用您的项目名称创建了一个备份文件夹。果然,我的项目备份文件夹在那里:Documents\Visual Studio 2010\Backup Files\MyProject。但是,文件夹是空的。我使用上面链接中列出的步骤“将此文件夹恢复到以前的版本”。这样做之后,该文件夹仍然是空的,但是,临时文件夹“C:\Users{Username}\AppData\Local\Temporary Projects”现在包含我的项目文件夹和文件。在运行“恢复到以前的版本”之前,临时项目文件夹也是空的。

So, I was able to copy the folder out of the Temporary Projects folder and I am as happy as one can be - or close to it.

因此,我能够将该文件夹从 Temporary Projects 文件夹中复制出来,我感到非常高兴 - 或者接近它。

Hope that helps someone out.

希望能帮助别人。

回答by sommmen

A note to the answers above, I had a mini jumpscare when i could not find my project anywhere, not in the recent projects nor in the visual studio projects folder.

对上述答案的说明,当我在任何地方都找不到我的项目时,我有一个小小的恐慌,既不在最近的项目中,也没有在 Visual Studio 的项目文件夹中。

I eventually found the project in the visual studio projects folder of the admin user;

最终在admin用户的visual studio projects文件夹中找到了该项目;

I was looking at:

我在看:

C:\Users\LocalUser\Documents\Visual Studio 2015\Projects

Whilst the project was saved under:

虽然该项目保存在:

C:\Users\LocalAdmin\Documents\Visual Studio 2015\Projects

Bottom line is; also check the \documents of the admin user. This likely happend because i was testing an admin only application and visual studio was running with the admin's user profile loaded.

底线是;还要检查管理员用户的 \documents。这可能是因为我正在测试一个仅限管理员的应用程序,并且 Visual Studio 正在运行加载了管理员的用户配置文件。