“There is no editor available for” Can't open .cs

后端 未结 11 1688
感情败类
感情败类 2020-12-18 23:35

My computer shut down while working on a project and when I opened C# again and recovered it, I got an error saying

There is no editor available \'for

相关标签:
11条回答
  • 2020-12-19 00:22

    In case you are using source control(which you should) you can just undo pending changes on the corrupted file. Worked for me

    0 讨论(0)
  • 2020-12-19 00:25

    As mentioned in the comments, your best option now is to repair or reinstall Visual Studio.

    0 讨论(0)
  • 2020-12-19 00:25

    You should repair or worst case scenario reinstall VS.

    I will say though you might be interested in looking into some version control software so you have backups of your code. There are plenty of free options out there so it wont cost you, but this software will allow you to easily rollback if you break something, and if you do have a crash like this and loose your work you only loose the changes since the last checkin.

    0 讨论(0)
  • 2020-12-19 00:29

    I had the same problem with a .cs file in Visual Studio 2017 after a crash. My solution was as follow:
    Go to the corrupted file in Explorer. In my case the corrupted Form1.cs contained only NULL values due to the crash (you can test this by opening in Notepad++ for example). Just backup or delete this file. In my case there was also a backup file in the same folder named like Form1.cs~string.TMP. Rename this to Form1.cs and reopen your project and double click on the Form1.cs and it will open successfully.

    0 讨论(0)
  • 2020-12-19 00:31

    There is no way to get the .cs file again (In my case after PC crash, two notepad files opened with no text in it, if I try to open the .cs file with notepad++ only null separator values). Have to redo the code again.

    0 讨论(0)
提交回复
热议问题