After installing the ASP.NET and Web Tools 2015 (RC1 update 1) I get the following error within ASP.NET MVC 4 projects when opening *.cshtml files:
I was getting similar error in VS2017 while trying to publish my solution to Azure.
This algorithm helped me to resolve it:
Note that this will remove your Visual Studio's recent files / projects from it's history and also linking to MS account.
This method is slightly different from the Top answer. Here you don't have to delete other folders except renaming abovementioned one.