How To Clear The Visual Studio Image Cache

The next minor release of the Visual Studio Icon Patcher is going to update around 190 images. By comparison the first release did 8. This is going to include areas such as the  CSS & HTML Document Outline, WinForms & HTML Toolbox, about half of the menus & toolbars, along with some smaller areas around debugging and TFS source control (this is unverified since I don’t use TFS, but a number of images are being updated for it).

Visual Studio 2012 with the 2010 theme and patched icons
Visual Studio 2012 with the 2010 theme and patched icons

Last night after running this version against my install I opened Visual Studio back up and none of the newly patched icons showed. After some digging around I found that there’s 4 cache files located under %LOCALAPPDATA%\Microsoft\VisualStudio\11.0 which need to be deleted in order for Visual Studio to load the new images. This covers the Toolbox but the IDE itself still doesn’t reload the new icons that show in the menus or toolbars. By accident I came across a workaround which is to disable any extension, such as the Theme Editor or VSCommands, then let Visual Studio restart. Once it reloads the new icons will show and you can turn the extension back on.

I’ve tried deleting just about every file in the AppData folder as well as my Temp folder in hopes of one of them being a cache file but none of them have worked. Something special is happening when an extension is disabled and I just can’t figure out what it is at the moment. Does anyone know what this might be?

Update
It looks like there’s two image caches that need to be cleared. The first are the toolbox*.tbd files located under %LOCALAPPDATA%\Microsoft\VisualStudio\11.0 and then the devenv.CTM file which is located in %PROGRAMDATA%\Microsoft\VisualStudio\11.0\1033. There’s also a file called ResourceCache.dll in this folder but so far it hasn’t had an effect on loading the new icons.

A word of caution.
I’ve seen a number of people who have tried replacing their Visual Studio 2012 DLLs with those from Visual Studio 2010. This will result in updated icons in some areas, but will also result in some parts of Visual Studio no longer working. Patching the DLLs is by no means the right way to do this, but it’s a much safer way than overwriting files with older versions. Plus the new files do contain resources that will be missing from the old versions and by the looks of it code too.

  • Truman

    Hi Brian,

    Thanks so much for working on this! Visual Studio developers the world over will be using this. I’m going to wait for your update before installing it – it sounds fantastic.

  • Ryan Molden

    The VS command system has its own cache, called a CTM file, which is a hidden file under AppData (the exact location depends on if you run VS as admin or not, you can just do a dir /s /a:H *.CTM from your root user dir to find it). Normally this is invalidated via devenv /setup, I believe the extension manager uses a slightly different approach which is faster (/setup also does project/item template extraction, which can be…slow), but it is also not public/supported. Alternatively, if you simply delete the .CTM file VS will notice its absence on next launch and rebuild it.

  • Len

    Excellent work Brian. MS had TWO years to work on the IDE…is this the ‘best’ they could do? My how the mighty have fallen.

  • Firedancer

    Awesome work. When is the next patch going to arrive? I am checking the site everyday anxiously waiting for it :)

    • Brian Surowiec

      The next version should be out in a day or two. It’s taking a bit longer than planned due to testing in some non English setups as well as with language packs installed. Hopefully this will prevent most non US English users from needing to download and change the code to get it to work for them.