Jetbrains Rider Cache Location

Resharper/Rider from Jetbrains are practically indespensible when coding .Net. The tools build an index over your code, and this helps navigating your huge code base. But this index needs to be maintained, and if you open a lot of solutions - and upgrade your IDE as the point releases drop - you risk running out of disk space.

In the Visual Studio plugin Resharper, it's possible to specify a custom location for the generated Solution Caches. Not so much in Rider. And that sucks, because the default location is in ~\AppData\Local\Jetbrains\Rider2xxx.x\, which is usually on the System drive unless you moved your users folder - and you really don't want to run out of space on your System drive.

Another issue is speed. If you don't have an SSD, you're f*cked. And even with an SSD, you may still be f*cked if your application is huge or has a lot of auto-generated crappy code (looking at you Altova XMLSpy!). I prefer to create a RAMDisk and use that.

 

So I googled like crazy and found this little gem which provided half the solution

 Open Rider
 - Press Help | Diagnostic Tools | Special Files and Folders
 - Right-click on the path next to R# global settings, select Open Folder
 - Open the file GlobalSettingsStorage.DotSettings for edit
 - Add a key similar to
 <s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\SomeCustomFolder</s:String>
 - Save the file and restart Rider.

So, GlobalSettingsStorage.DotSettings is stored in ~\AppData\Roaming\JetBrains\Rider2021.2\resharper-host (as of Dec 2021), so you don't need to to the first steps. The important part is the adding of <s:String x:Key=etc.>. Which is how to specify the where. But as per Rider 2021.2.2 it also needs a LocationType!

So the lines to add are 

<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\SomeCustomFolder</s:String>
<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/LocationType/@EntryValue">CUSTOM_FOLDER</s:String>

Again, I wouldn't use the C-drive, but in stead use my mapped RAMDisk

Comments are closed