4

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

10
  • I have the same problem after installing Update 2, but instead of crashing I get an error popup that says "The document cannot be opened. It has been renamed, deleted or moved."
    – simonauner
    May 14, 2014 at 9:33
  • working fine here after the update on Win8.1 system. Maybe try creating a new solution?
    – SkyBlues87
    May 14, 2014 at 10:29
  • Of course i also tried setting up a new project/solution
    – daniel
    May 14, 2014 at 10:30
  • looked in event viewer for leads??????
    – SkyBlues87
    May 14, 2014 at 10:40
  • what do you mean by that?
    – daniel
    May 15, 2014 at 10:21

12 Answers 12

14

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

2
  • 1
    Deleting the suo file did not work, but uninstalling Xamarin worked for me as well.
    – JebaDaHut
    Apr 13, 2015 at 13:46
  • Worked for me. Another reason not to have xamarin :-)
    – Alex
    Jun 19, 2015 at 8:50
5

For me, resolve the issue by running visual studio as a administrator.

3
  • I'm already running as admin and have this issue: no success. Feb 1, 2015 at 22:09
  • It worked for me too, although my issue was not being able to open a .cs file.
    – p8me
    May 11, 2016 at 21:54
  • Works for me too. I wonder if anyone can weigh in on why this is working for some people. Doesn't make a whole lot of sense.
    – levininja
    Jan 11, 2017 at 16:41
1

What worked for me:

  1. Delete the suo file
  2. Re-opened VS from the sln file

Ciao

1

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.

1

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.

0
0

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" />
1
  • Personnally, I've the token already set with PublicKeyToken so I haven't had chances with this workaround. Feb 1, 2015 at 22:10
0

What worked for me:

  1. Disable razor generator extension.
  2. Restart VS.
  3. Open file.
  4. Re-enable razor generator extension.
0

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.

0

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.

0

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.

0

if you have xamarine installed , try uninstalling it , that worked for , after trying all the other options

-2

complete unistall and reinstall of VS solved the problem for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.