简体   繁体   English

在记事本中打开VS2010 CS文件

[英]VS2010 cs file opening in Notepad

Yesterday while was writing code in model Repository suddenly power off. 昨天,当在模型存储库中编写代码时,突然断电。 I left and when I open now Repository.cs was opening in notepad. 我离开了,现在打开时,Repository.cs在记事本中打开。 Actually in Notepad it is empty. 实际上在记事本中它是空的。

Any way to recover the code as I don't have back up of my whole days work? 有什么方法可以恢复代码,因为我没有备份整天的工作?

How to reopen it? 如何重新打开?

Try with this.. 试试这个..
There are possibility for code loss when power breaks are there.. The primary solution is You can recover from back up files and add it with ur application. 停电时,代码可能会丢失。主要解决方案是, 您可以从备份文件中恢复并使用您的应用程序将其添加。 or If you have AutoRecovery enabled, you might be lucky enough to find a backup of the file. 或如果启用了“自动恢复”,则可能很幸运可以找到文件的备份。 Chances are that Visual Studio would've prompted you to restore the corrupted file when launching it after the crash. 崩溃后,Visual Studio可能会在启动时提示您还原损坏的文件。 Anyway it's still worth checking the backup folder for your project, in: 无论如何,仍然值得在以下位置检查项目的备份文件夹:

%USERPROFILE%DocumentsVisual Studio [Version]Backup Files[Solution Name] %USERPROFILE%DocumentsVisual Studio [版本]备份文件[解决方案名称]

Other ways to recover 其他恢复方式

Recover the affected file in VS 在VS中恢复受影响的文件

Don't quote me on this. 不要在这上面引用我。 But you may try opening the entire project inside of VS2010 IDE, and it may be cached in there. 但是您可以尝试在VS2010 IDE中打开整个项目,并且可以将其缓存在其中。 I'm assuming you know how to open files with other programs. 我假设您知道如何使用其他程序打开文件。

You can recover the file. 您可以恢复文件。 Do this if anyone still having this issue. 如果仍有问题,请执行此操作。

1) Exclude the file from Solution Explorer(Right Click>>Exclude) 2)Include the file again (Right click in directory icon in Solution Explorer>>Add>>Add Existing Item) 1)从解决方案资源管理器中排除文件(右键单击>>排除)2)再次包含文件(在解决方案资源管理器中右键单击目录图标>>添加>>添加现有项)

You will have the file available in Visual Studio. 您将在Visual Studio中获得该文件。

Hope this help 希望这个帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM