Since yesterday I'm not able to edit cshtml files. Each time I try to edit a cshtml file I get the following message:
"The document cannot be opened. It has been renamed, deleted or moved."
It all started when trying to fix an issue with TypeScript not saving on compile. As nothing seemed to work I noticed the update to a .Net SDK (DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe). The install took a long time and I eventually cancelled it. Since then I can't edit any cshtml files.
I created a new mvc project to see if I can edit cshtml files there, but it also doesn't work.
I tried everything I could find apart from a complete re-install but nothing seems to fix it. I saw the discussion on https://github.com/aspnet/Tooling/issues/390 but none of the suggestions helped.
cshtml file indicates that the file is a Razor Page.
cshtml extension is a C# HTML file that is used at server side by Razor Markup engine to render the webpage files to user's browser. This server side coding is similar to the standard ASP.NET page enabling dynamic web content creation on the fly as the webpage is written to the browser.
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With