简体   繁体   English

Visual Studio视图(.cshtml)崩溃且无法恢复

[英]Visual studio view (.cshtml) crashed and cannot recover

My view file(.cshtml) crashed and turned into as shown in image below. 我的视图文件(.cshtml)崩溃并变成了如下图所示。 Actually, it happened right after the system was unexpectedly shut down. 实际上,它是在系统意外关闭后立即发生的。 I tried other solutions like clearing temp files from bin. 我尝试了其他解决方案,例如从bin中清除临时文件。 I tried to open it with notepad++ but it didn't work. 我试图用记事本++打开它,但是没有用。 Any help will be appreciated. 任何帮助将不胜感激。 在此处输入图片说明

Download WinHex program and open your corrupted file with it. 下载WinHex程序,并用它打开损坏的文件。

  1. Go: Tools > Open Disk 前往:[工具]> [开启磁碟]
  2. Navigate to your corrupted file 导航到损坏的文件
  3. Double click on it 双击它

If there is non-zero values , just copy and paste all this data to you new file. 如果存在非零值 ,只需将所有这些数据复制并粘贴到新文件中即可。

I'm afraid you've lost it. 恐怕你丢了它。

If you have a VCS in place (which you should), restore the file from there. 如果已安装VCS(应该这样做),请从那里还原文件。 Also, see if there are any previous versions of the file and try to fish it out from over there. 另外,请查看文件是否有以前的版本 ,然后尝试从那里钓鱼。 Lastly, check your general-purpose backups, if you happen to have those. 最后,如果您碰巧有那些通用备份,请检查一下。

If you have published your content, then in visual studio you can right click on the specific file and choose 'replace [fileName] from server'. 如果发布了内容,则可以在Visual Studio中右键单击特定文件,然后选择“从服务器替换[fileName]”。 This will download an uncorrupted version of your content from the published site. 这将从发布的站点下载内容的未损坏版本。

Hope this helps. 希望这可以帮助。

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

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