While there's always ReSharper clear caches through the Visual Studio settings...
I've been using the command line more recently, so decided to make a script to do this from the root directory of the repo. Depends on having Git installed on the command line. And expects the ReSharper version is 8.2. And that you haven't tweaked where RS keeps it caches.
Its a PowerShell script, so add the contents to your PowerShell profile and set an alias if you like.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-CurrentRepoName(){ | |
$repoPath = git rev-parse --show-toplevel | |
$repoName = basename $repoPath | |
return $repoName | |
} | |
function ClearReSharperSolutionCache(){ | |
$repoName = Get-CurrentRepoName | |
$rootPath = $env:localappdata + "\JetBrains\ReSharper\v8.2\SolutionCaches\" | |
$folders = get-childitem $rootPath | |
$exp = "_Resharper\." + $repoName + "\.-?\d+" | |
$found = $FALSE | |
foreach ($folder in $folders) { | |
if($folder -match $exp){ | |
$found = $TRUE | |
$fullPath = $rootPath + $folder | |
Try | |
{ | |
remove-item $fullPath -recurse -confirm -errorAction Stop | |
} | |
Catch | |
{ | |
write-warning "Please close Visual Studio running $repoName" | |
} | |
} | |
} | |
if(!($found)){ | |
write-warning "No ReSharper cache found for $repoName" | |
} | |
} |