How to clear visual studio cache
Many times, during development you would face situations where project references are not loaded properly or you get missing/error DLL's. This is because the Component cache gets corrupted randomly and without any warnings. The first option that needs to be done is to clear component cache and restart Visual Studio since the Cache might be holding onto previous DLL versions. Here are the steps on how to clear Visual Studio Cache,
Clearing Component Cache:
- Close all Visual Studio Instances running in your machine. Also, make sure devenv.exe is not running in the Task Manager
- Delete the Component cache directory -%USERPROFILE%\AppData\Local\Microsoft\VisualStudio\1x.0\ComponentModelCache
- Restart Visual Studio
The above steps should fix the cache issue most of the times, but some times that is not enough and you need to perform the below steps as well.
Clearing User's Temp Folder:
- Open the temp folder in this location - %USERPROFILE%\AppData\Local\Temp
- Delete all the files in the temp folder
If both of the above-listed steps don't work there is a final option(hard-route option) that you could try to clear cache in Visual Studio.
Delete the files from these locations
- %USERPROFILE%\AppData\Local\Microsoft\Team Foundation
- %USERPROFILE%\AppData\Local\Microsoft\VisualStudio
- %USERPROFILE%\AppData\Local\Microsoft\VSCommon
Run the below command after deleting the files from the above folders,
C:\Program Files (x86)\Microsoft Visual Studio 1x.0>devenv /resetuserdata
This command will reset the user information in VS. Please make sure you export your settings under Tools -> Options before running this command