I installed the new VS2013 Update 2. As soon as I open a .cshtml file VS crashes.
I tried:
- repair VS
- deactivated all extesions
- devenv.exe /ResetSkipPkgs
- resetted all settings
without success
I installed the new VS2013 Update 2. As soon as I open a .cshtml file VS crashes.
I tried:
without success
I had the same error after installing Xamarin. The Xamarin extension in Visual Studio couldn't be disabled so I had to completely uninstall from Control Panel.
Anyone looking for a solution that doesn't involve uninstalling, this link might help: https://bugzilla.xamarin.com/show_bug.cgi?id=26850
For me, resolve the issue by running visual studio as a administrator.
What worked for me:
Ciao
Most probably this would be happen after Xamarin VS extension installed.
So please follow below steps to fix. This worked for me.
Close all instances of Visual Studio.
Go into your "(Visual Studio install path)\Common7\IDE\Extensions\Xamarin\Xamarin\3.9.483.0\"
And rename the three files: System.Web.Razor.dll, System.Web.WebPages.dll, and System.Web.WebPages.Deployment.dll into System.Web.Razor.bad, System.Web.WebPages.bad, and System.Web.WebPages.Deployment.bad.
Search your registry with the registry editor and remove the "RazorTemplatePreprocessor" key.
Delete your solution user preferences files: (Solution Name).suo
When you start up Visual Studio, You can open the csHTML files.
This happened to me too when installing Razor Generator. I had a second copy of Visual Studio open when I installed Razor Generator.
I closed out of all instances of Visual Studio and reopened, and that fixed it.
For me this issue was caused by a config problem in Views/Web.config. The following change fixed the issue:
<system.web.webPages.razor>
- <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicFixedGuidToken=31BF3856AD364E35" />
+ <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
What worked for me:
I was having this same issue (had just installed Xamarin on Visual Studio 2013, and then all .cshtml views were not opening and acting like they were not there).
Installing VS2013 update 4 fixed my issue.
I resolved the problem by renaming the %LOCALAPPDATA%\Microsoft\VisualStudio\12.0\ ComponentModelCache folder to ComponentModelCacheOLD. First I had to quit VS2012, rename the folder, and then restart VS 2012. All problems went away.
I know this is somewhat old, but I wanted to throw in what solved the issue for me as everything above (yes, even an uninstall and reinstall of VS failed to work).
I had to uninstall Microsoft ASP.NET and Web Tools (you can't do this through VS, you have to download the installer for the version you have and use it to uninstall it).
I then reinstalled Microsoft ASP.NET and Web Tools and made sure it was up-to-date. This resolved the issue for me.
if you have xamarine installed , try uninstalling it , that worked for , after trying all the other options
complete unistall and reinstall of VS solved the problem for me.