VS2015 Not able to edit cshtml files

Try to clean the contents in the following cache folders (do not delete these folders, instead delete their contents only) and restart Visual Studio:

  • Clean the content in WebSiteCache folder (can be found in
    C:\Users\%USERNAME%\AppData\Local\Microsoft\WebSiteCache)

  • Clean the content in Temporary ASP.NET Files folder (can be found in
    C:\Users\%USERNAME%\AppData\Local\Temp\Temporary ASP.NET Files)

And then restart Visual Studio. If the problem continues you might try to rename the project folder and reopen it again. Hope this helps...


Follow below steps to resolve this issue:

  1. In the Individual components section of the Visual Studio Installer, make sure that Razor Language Services is checked.
  2. After installation, make sure that Razor Language Services is enabled in the Installed section of Tools > Extensions and Updates dialog.
  3. Restart Visual Studio.

Reference: https://developercommunity.visualstudio.com/content/problem/194267/the-document-cannot-be-opened-it-has-been-renamed.html