title: Reduce log and other temporary file creation in Visual Studio 2019
body: <p>My work development PC is resource-constrained with only 28GB for the main system disk. There is a 1TB external HDD and some data and applications have been moved there.</p>
  
  <p>However, I'm still regularly running into Windows 10 "Low Disk Space" warnings which are triggered when free space drops below ~1GB. While actively working, this happens several times a week. You have to waste time deleting temporary files, emptying the recycle bin, etc.</p>
  
  <p>There are naturally many causes, but the primary culprit in my case and the focus of this question is Visual Studio 2019. Whenever I perform even a simple build (C++ DLL and EXE projects), Visual Studio 2019 creates dozens of files all over the disk. After several days, the number can be in the thousands and GBs in size. Very few of these files appear to be essential - you can generally safely delete them while the project is still open in Visual Studio!</p>
  
  <p>Examples include:</p>
  
  <ul>
  <li>%LOCALAPPDATA%\Microsoft\VisualStudio\SettingsLogs*</li>
  <li>%LOCALAPPDATA%\Temp_CL_*</li>
  <li>%LOCALAPPDATA%\Temp\dd_BackgroundDownload*.log</li>
  <li>%LOCALAPPDATA%\Temp\dd_updateconfiguration*.log</li>
  <li>%LOCALAPPDATA%\Temp\servicehub\logs*</li>
  <li>%LOCALAPPDATA%\Temp\VSFeedbackIntelliCodeLogs*</li>
  <li>%LOCALAPPDATA%\Temp\VSRemoteControl*</li>
  <li>.vs (eg. IntelliSense database)</li>
  </ul>
  
  <p>and many more.</p>
  
  <p>What steps can I take to:</p>
  
  <ul>
  <li>reduce (or eliminate) all but essential temporary/cache files</li>
  <li>move temporary/cache file generation to the external disk</li>
  <li>request Visual Studio to clean up after itself when the IDE is closed</li>
  </ul>
  
  <p>Don't bother with unhelpful comments like "get a larger disk". Even with a large local HDD it would be sensible to reduce the number and size of files hitting disk. Given enough time, any disk will eventually run into this problem.</p>