4

I'm having a problem with ReSharper giving obviously wrong advice. For example, in the following code sample, ReSharper is saying that the response, dates, and ex variables are never used, when they are clearly used on the following lines:

Dim response As New WcfResponseBoolean
Try
    ' ReSharper identifies 'b' as unused, but it is used on the next line.
    b = Builders.CastBuilderFromSession

    If b Is Nothing Then
    response.SetSessionExpired()
        Return response
    End If

    ' ReSharper identifies 'dates' as unused, but it is used on the next line.
    Dim dates As New List(Of DateTime)({ConvertToUSDateTime(inWithTime)})

    CompareDateList(response, inTimeToCompare, New ComparableDatesList() 
        With {.Dates = dates, .CheckCompareType = compareType}, False)

' ReSharper identifies 'ex' as unused, but it is used on the next line.
Catch ex As Exception
    MailHandler.SendExceptionEmailToBTDebug(ex, "CompareDates")
    response.SetUnhandledException()
End Try

I've followed the advice from this link to try clearing ReSharper's caches by going to ReSharper --> Options --> Environment --> General and clicking the "Clear Caches" button. But when I click that button, I get no feedback from ReSharper that anything happened. The screen just sits there; no popup message, no UI feedback of any kind. And when I click the Save button to close the form, the problem persists.

TL;DR:
Is there a different way I can clear ReSharper's cache? Failing that, is there a different way to get the static analyzer working again?

I'm running ReSharper 8.1.23.546 in Visual Studio 2012 (version 11.0.61030.0).

UPDATE 1:

I've also tried cleaning and rebuilding the project, and closing and opening Visual Studio. Neither of these have had any effect. The only two things I can think to do from here are:

  1. Delete ReSharper's cache files manually. But I don't know where they are located, and I'm not sure that is safe to do.
  2. Uninstall and reinstall ReSharper. But that seems drastic. I'd prefer not to do this unless it is the only option left.

UPDATE 2:

I used citizenmatt's answer to locate and delete the cache files, but it didn't make any difference. ReSharper is still identifying the variables as unused.

I also rebooted my PC, which I had not done yet, but as I expected that didn't really change anything. I may be getting to the point that uninstalling and reinstalling is the only option left.

UPDATE 3:

I came back from lunch and decided to bite the bullet and do an uninstall and reinstall. That did not fix this issue either. Now I'm getting desperate.

Community
  • 1
  • 1
Katie Kilian
  • 6,815
  • 5
  • 41
  • 64
  • Thanks for providing the updates. I was having the same problem, and your update 1 worked for me. – Druzil May 28 '14 at 05:58
  • 1
    Did you ever find a solution for this? I am having the same issue with Resharper. – NJH Oct 31 '17 at 23:38

1 Answers1

1

You can find the solution caches at %LOCALAPPDATA%\JetBrains\ReSharper\v8.1\SolutionCaches. The cache folder is named _ReSharper.{Solution}.{hash}, where {solution} is the name of the solution, and the hash is a numeric value to prevent name clashes. You should be able to find the one you're looking for. Delete it with Visual Studio closed and reopen the solution.

citizenmatt
  • 18,085
  • 5
  • 55
  • 60
  • Thanks for the answer. I was able to use this information to locate the cache files and delete them. Unfortunately, this did not fix my issue. ReSharper is still incorrectly identifying the variables as being unused. – Katie Kilian Jan 16 '14 at 15:23