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
In case you are using source control(which you should) you can just undo pending changes on the corrupted file. Worked for me
As mentioned in the comments, your best option now is to repair or reinstall Visual Studio.
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.
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.
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.