2

When editing a CSHTML page, ReSharper is intermittedly showing some valid Razor syntax in red indicating an error. The syntax is red when I open the file, turns normal when I make an edit, then turns red again after a save:

ReSharper CSHTML error

Even when red, the code builds successfully and ReSharper even gives correct information about the syntax on hover:

enter image description here

My environment is:

  • ReSharper 10.0.2
  • Visual Studio Enterprise 2015 Update 1
  • ASP.NET 4.5
  • MVC 5

I have tried the solutions offered in other questions (e.g. ReSharper "can not resolve symbol" even when project builds, Resharper is suddenly showing red for Razor syntax) like Suspending/Resuming ReSharper, clearing caches, etc. I even tried reinstalling ReSharper entirely but none of that helped.

Potentially relevant (?) is that I recently installed MVC 3 and MVC 4 for other projects, but I have since uninstalled them again.

Any suggestions for what might be causing this? Could it be a ReSharper bug somehow?

UPDATE:

This actually only happends when a ReSharper code cleanup is run and then a save is made. I had an extension which did this automatically on every save, but having disabled that the actual flow is:

  • Make edits - OK
  • Save - OK
  • Clean up - OK
  • Save - RED

I am using the Default: Full Cleanup profile.

Community
  • 1
  • 1
Jamie Humphries
  • 3,368
  • 2
  • 18
  • 21

1 Answers1

2

This appears to be a symptom of a known ReSharper bug, due to be fixed in version 10.1

See https://youtrack.jetbrains.com/issue/RSRP-455788

Jamie Humphries
  • 3,368
  • 2
  • 18
  • 21