Jamie Humphries
Jamie Humphries

Reputation: 3688

ReSharper intermittently showing red errors for valid Razor code

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:

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:

I am using the Default: Full Cleanup profile.

Upvotes: 2

Views: 1946

Answers (1)

Jamie Humphries
Jamie Humphries

Reputation: 3688

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

Upvotes: 2

Related Questions