VS2015 Failed to edit cshtml files

Since yesterday, I can’t edit cshtml files. Every time I try to edit the cshtml file, I get the following message:

"The document does not open; it has been renamed, deleted, or moved."

It all started when you tried to fix the problem with TypeScript without saving during compilation. Since nothing worked, I noticed a .Net SDK update (DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe). The installation took a lot of time, and I eventually canceled it. Since then I can not edit any cshtml files.

I created a new mvc project to see if I can edit cshtml files there, but it also does not work.

I tried everything I could find, except for a complete reinstall, but it doesn’t fix anything. I saw a discussion on https://github.com/aspnet/Tooling/issues/390 , but none of the suggestions helped.

+7
source share
2 answers

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

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

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

And then restart Visual Studio. If the problem persists, you can try renaming the project folder and reopening it again. Hope this helps ...

+2
source

To resolve this issue, follow these steps:

  1. Verify that the Razor Language Services check box is selected in the Individual Features section of the Visual Studio installer.
  2. After installation, ensure that Razor Language Services is enabled in the Installed section of the Tools> Extensions and Updates dialog box.
  3. Restart Visual Studio.

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

0
source

Source: https://habr.com/ru/post/1264873/


All Articles