187

I am unable to edit any files in a project in Visual Studio 2013. It only happens in one project. If I open a different project I am able to type fine, but once I go back into the problem project I am unable to type in the editor windows. Not sure if it matters but the project that is giving me issues we are using SVN on. The other projects are just local ones on the machine. I have restarted Visual Stuido, restarted the computer and still am unable to edit the files. Any ideas?

Mikael Engver
  • 4,634
  • 4
  • 46
  • 53
Corey Witherow
  • 2,472
  • 2
  • 26
  • 37
  • Do you use some SVN plugin for Visual Studio? If you do, it might be the source of the problem. The only time VS doesn't allow me to edit a file is when this bug occurs when I try to edit a file during debugging. What the bug does is basically keep the file in read-only mode after I stop debugging (reopening the file or restarting VS does seem to help). VS has another similar bug that prevents you from copy-pasting files within your project after you tried to do so during debugging (sometimes this can be only be fixed by restarting the computer). – jahu Aug 12 '14 at 09:13

6 Answers6

401

This exact thing happened to me. Do you have ReSharper? If so, the solution I found here may work for you. From Alexander's comment in the accepted answer:

Try cleaning R# caches C:\Users{User Name}\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches\ and then reopen the solution

From below comment - that's %userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches for those that want to Win+R.

From comment below, another possible location: %userprofile%\AppData\Local\JetBrains\Transient\ReSharperPlatformVs12\v02\Soluti‌​onCaches

Update - Another Easier Option:

You can also go to ReSharper option, Environment/General, click on Clear Caches and restart Visual Studio – Chin Feb 27 at 2:02 enter image description here

Community
  • 1
  • 1
Steve
  • 7,747
  • 5
  • 31
  • 44
  • 7
    This worked for me. Only one of my projects was being affected and it was driving me crazy! I will submit a bug report to jetbrains so hopefully this is a short term issue. – Ravendarksky Jan 09 '15 at 10:00
  • 4
    Worked for me. This issue is still present in R# 8.2.3 and VS 2013 Update 4. – Den Jan 12 '15 at 10:40
  • 5
    I had same problem and this solution solved it. I have VS 2013 Professional & ReSharper 8.2 C# edition – dvdmn Jan 15 '15 at 15:03
  • I too suffered this issue. I tried to see if there was an issue being tracked by JetBrains that I could up vote but their bug tracking system is complex to say the least. Anyone else have any luck in this manner? – ctrlplusb Jan 20 '15 at 16:23
  • 1
    Worked for me too. 8.2.2 and VS2013 Update 4 – Philip Ding Jan 27 '15 at 02:42
  • 13
    That's `%userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches` for those that want to Win+R. – antak Feb 05 '15 at 03:02
  • This solution worked for me in Resharper 9 VS2013 Update 4 too. – Cardin Feb 24 '15 at 00:38
  • You absolute beauty. Finally went back to an older solution I had to shelve and was struggling to edit all but one project in it. Instant fix. – CannonFodder Feb 25 '15 at 08:07
  • 33
    You can also go to ReSharper option, `Environment/General`, click on `Clear Caches` and restart Visual Studio – Chin Feb 27 '15 at 02:02
  • Still present in 9.0 Update 1. +1 I only use ReSharper when I absolutely have to, for e.g. cleaning code. Other than that it's just annoying. – Bent Tranberg May 07 '15 at 08:36
  • 1
    +1 This worked, I can't believe they would have such a crippling bug in their product. Shameful I tell ya, shameful. – lkg May 12 '15 at 20:49
  • Funny thing is, even if you can't type anything, you can still comment and uncomment lines via shortcut. – Obl Tobl Jun 10 '15 at 08:30
  • 1
    Still getting this, seems to have moved to %userprofile%\AppData\Local\JetBrains\Transient\ReSharperPlatformVs12\v02\SolutionCaches – ColWhi Aug 12 '15 at 16:32
  • This also fixed the issue with Resharper 9.1.3 on VS2013. – Marc-Andre R. Aug 19 '15 at 15:02
  • 1
    Solved it for VS 2015 with ReSharper Ultimate. – Adam Sep 07 '15 at 02:28
  • Clearing cache solved the problem for VS2013 and Resharper 9. – Dio Phung Sep 20 '15 at 06:27
  • over a year later , and still this worked , thanks for SO - otherwise me and 266 others would be screwed . I never would of thought of that – Scott Selby Oct 16 '15 at 03:03
  • Worked for me. But ive had to many problems with resharper to use it for much longer. Im on my last straw. – codemonkeyliketab Mar 28 '16 at 17:11
  • Worked for me (ReSharper Ultimate 10.1 EAP 10). (FWIW I had to switch to an EAP to get around an unrelated regression in 10.0.2). – Chris R. Donnelly Apr 12 '16 at 21:20
  • For future stackers: set resharper to use Temp folder when you clear the cache. this should make resharper's cache clear everytime you log off or reboot and probably a bit more often than that. I'm on Resharper 8.2.3 and it works for me. – Richard Barker Apr 28 '16 at 20:40
  • Thank you so much, would have taken me days to get this fixed by myself ;) Obviously though, the bug has not been removed by JetBrains: ReSharper Ultimate 9.2 (2015.2), Visual Studio 2015 (14.0.25123.0)... Ridiculous! – Marc Jun 03 '16 at 07:26
  • I don't have resharper tools tab in visual studio, I am unable to edit .cs file.. please help!! @Steve – Jamshaid K. Jun 19 '16 at 13:51
  • This solved my problem too. Happened after I updated ReSharper from within VisualStudio 2010. – Case 303 Sep 08 '16 at 16:18
  • Lastest Visual Studio 2017 15.3.26730.12 + Latest Resharper 2017.2 and I still cannot edit files even after deleting Transient's SolutionCaches folder or cleaning cache in Resharper options. – Junior Mayhé Sep 03 '17 at 18:26
13

I had this same issue today (couldn't even edit brand new files), but it turned out to be due to the "Source Control Plug-In". I use AnkhSVN and performed an update when prompted yesterday. For whatever reason this left me unable to edit any file types besides JSON. Here are the steps I went through to fix it:

  1. Open Visual Studio options (Tools -> Options)
  2. Change the "Source Control Plug-In" to "None" (Source Control -> Plug-in Selection)
  3. Restart Visual Studio
  4. Repeat steps 1-3, except re-enable AnkhSVN in step 2

I was able to edit files again after this.

Taylor Buchanan
  • 4,155
  • 1
  • 28
  • 40
6

Simply delete your all temp files from the temp folder.

Note: Before deleting the temp files, close Visual Studio.

To delete temp files:

  1. Open the Run window by pressing Windows button + R.
  2. Type %temp% in the text box.
  3. Press Enter.

Run window image

Now you will see your all temp files. Just press Ctrl+A to select all files in the temp folder. Now delete all of them. some files will not be deleted. Just skip them.

Now open your Visual Studio and try to edit syntax. I hope it will work now!

Amal K
  • 4,359
  • 2
  • 22
  • 44
sydur.rahman21
  • 169
  • 1
  • 2
  • 8
1

Are the files in question read-only? That might explain why you can't change them.

I'm not familar with SVN, but in some source control systems, you have to check-out a file before you modify it.

rdoffing
  • 67
  • 2
  • The files aren't set to read-only. Usually I can just edit without checking them out. I've had visual studio do this to me before on other projects, but each time its happened I've been able to restart visual studio and its fine. – Corey Witherow Jul 18 '14 at 13:37
  • Usually you can edit without checking them out...in Visual Studio? Or some other editor? Most editors will let you make changes to read-only files, they'll only complain when you go to save. How did you check the read-only status? Did you actually check the "readonly" attribute on the file properties? SVN can set this automatically, if the "svn:needs-lock" property in SVN is set for that file. – Ben Jul 18 '14 at 16:32
0

Happened to me today, for me the problem was with typescript files. I couldn't write in any .ts file, and this was because I created a tsconfig.json file, but didn't populate it yet (it was empty). Then I was interrupted and forgot I had this empty file, and it took me a while to realize this was the cause of the issue. This issue happened in visual studio 2015.

youen
  • 1,952
  • 1
  • 23
  • 32
  • 1
    Something similar happened to me today in VS 2019, where enter and arrow keys weren't working but I could type characters. By default, the keyboard mapping is set to **ReSharper (Visual Studio)**. To fix this, I went into Options|Environment|Keyboard and clicked the Reset button. After reset finished, I reselected **ReSharper (Visual Studio)** and clicked OK. – Opus4210 Nov 27 '19 at 21:29
  • @Opus4210 this was the fix for me, you may want to consider adding it as a separate answer because it seems pretty different from the answer you commented on. – Chakrava Mar 26 '21 at 17:11
0

I added an extension that included the Spell Right extension. Once I uninstalled Spell Right it fixed the problem.