Resharper 6 - Razor code highlighting not working

I just upgraded to Resharper 6 and was dismayed to find that Resharper has broken code highlighting for Razor code in cshtml.  Most of the code in a Razor block is not highlighted at all, which makes it quite difficult to tell when the block starts and ends.

How can I revert to the built-in Visual Studio code highlighting for cshtml / Razor files?

1 comment

Another person on my team experienced the same issue as I did, also apparently due to installing Resharper 6.  However, after two days debugging the issue together and trying multiple machines, we finally found the culprit.  It is not related to Resharper.  It was coincidental that a change was made to a project file in source control at the same time that both of us upgraded to Resharper 6.  This change seemed innocent but breaks MVC support in Visual Studio, with or without Resharper installed.

The change that broke MVC switched the OutputPath from "bin" to "bin2\$(Configuration)".  The change was made because otherwise building both Debug and Release caused one configuration to overwrite the other one, and ASP.NET uses the "bin" path for its own purposes.  After experimentation we found that MVC breaks any time the OutputPath is more than one directory deep, and the top level directory is not "bin".  So "bin$(Configuration)" works, "bin\$(Configuration)" works, even "foo" works.  But "foo\bin" does not work because it is two levels deep and the top level is not "bin".

I apologize for assigning the blame for this issue to Resharper.  The cause was obscure and the timing was pure coincidence.  I am now using Resharper 6 again and hopefully will not experience any more strange issues!


Please sign in to leave a comment.