7

I'm having trouble with solution wide analysis since I upgraded to resharper 4.5.

I'm continually getting false negatives, and having resharper report errors with my code that are not there.

I find the only way to get rid of the errors is to open each of the reported in error files, find the offending types/classes, open those files and then close everything again, which seems to force resharper to re-analyze everything.

I believe there is a defect already @ jira, but I'm looking for handy tips on how to quickly force resharper to re-analyze the files in error...

John Weldon
  • 39,849
  • 11
  • 94
  • 127
  • 2
    I've seen this occasionally in earlier versions too, the analysis would color a single file practically all red. Close/reopen of the file or solution wouldn't help, sometimes not even close/reopen of VS. I have a vague recollection that I may have wiped ReSharper's cache files in an attempt to fix the situation, but I really don't remember whether or not that worked. – Rytmis May 12 '09 at 20:37
  • 1
    I've had similar problems, and the latest nightly build (4.5.1236.0) seems to fix it – Jim Arnold May 14 '09 at 16:45
  • Excellent. I had the 4.5.1234.4 build and didn't see an update yesterday. Thanks! – John Weldon May 14 '09 at 17:57
  • The latest build didn't help... I'm still getting these issues today. :-/ – John Weldon May 15 '09 at 14:58

5 Answers5

13

When this happens to me I use shift+alt+Page-Down for scrolling to next error in solution. Just spaming through the errors will make Resharper re-analyze the files. Not a good solution, but it works.

Edit: If you go to the menu ReSharper -> Windows -> "Errors in Solution" you will get a window up called "Errors in Solution". There you have a button to the right called "Reanalyze Files With Errors". You can even put it on a shortcut.

Slampen
  • 790
  • 9
  • 21
11

Delete your resharper cache files regularly - especially if you've upgraded from a previous version. You'll most likely have an _Resharper.* file somewhere under your solution folder. This entire folder structure can be blown away and, when Resharper misbehaves for me, I do this.

Martin Peck
  • 11,440
  • 2
  • 42
  • 69
  • Thanks for this. After going through and deleting all the Resharper folders and files throughout the solution and its constituent projects, solution-wide analysis is working. – Jay Aug 05 '09 at 15:50
1

Depending how large your solution is, this may be a huge pain, but I have the same problem occasionally, and if I build the project showing the errors, it goes away.

For example, just yesterday, it couldn't find an Excel library for one of our smaller projects, and it was entirely red, even though nothing had changed, all DLLs were found and referenced, and nothing was evidently wrong. I just rebuilt that individual project, it compiled with no errors, and the red bars went away immediately.

Chris Doggett
  • 19,959
  • 4
  • 61
  • 86
0

Looks like an issue in resharper then. It's usually better to report it directly at them, then waiting for them to find out about this question.

Also, it's more a bug report than a programming question.

Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
  • Yes I did mention that there was already a bug report, and that I was only looking for workarounds that anyone else had found. Thanks anyway. – John Weldon May 13 '09 at 22:52
0

Same here, but then again I've been getting false positives (or negatives) for ages. The two fail points for me were WPF (XAML, specifically) and using Unicode in code files (i.e., programming using non-Latin letters.)

I would suggest simply switching it off, especially considering the performance price you pay for it.

Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166