How to make ReSharper re-evaluate its assembly reference highlighting

Vaccano picture Vaccano · Mar 21, 2012 · Viewed 44.2k times · Source

I am creating a Prism Project Template, and the template works great. But after I create a project with the template some of the files look like this:

Bad References

Despite appearances, everything is just fine.

If I do a Rebuild All I see that the solution builds with no errors:

Rebuilt

But the rebuild all does not get rid of the "errors" that are showing in the editor window. (Note that the actual error window does not show any errors.)

I can clean, rebuild, close and open files, and it will not fix the highlighting.

However, if I close the solution and re-open it, all is well:

Works After Reload

My Question:

Ideally there would be a way for my template or my IWizard to tell ReSharper to reload the references for the highlighting.

I know I can turn ReSharper off and then on again and that will fix it, but I would rather not do that.

Is there a ReSharper command that just refreshes this stuff?

Answer

iggymoran picture iggymoran · Jul 23, 2013

Except for reinstalling, the only way to successfully clear the caches is to delete the files manually from your AppData directory.

Delete the solution folder that's giving you grief in the following locations:

  • %LOCALAPPDATA%\JetBrains\ReSharper\v7.1\SolutionCaches\
  • %LOCALAPPDATA%\JetBrains\Transient\ReSharperPlatformVsXX\vXX\SolutionCaches\ for newer versions.

Note that the version numbers in the paths may be different depending on the ReSharper version that is installed.

The XX in vXX and VsXX represents any number, because there might be multiple folders where the solution cache is stored.