We have an ASP.NET website which uses .NET framework 4.6, and we use rider and visual studio to work on it.
Every once in a while, I have found people getting old razor files that still try to look for functions/references which no longer exist. I understand that those razor files are cached, and we need to clear the cache.
So, we usually go to these steps
- Clean %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\\ComponentModelCache
- Clean C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root
- Clean the \obj and \bin from the project folder structure, wherever applicable.
Some combination of these steps usually work for most people but when it doesnt work, we have to manually go to each razor file (which is complaining with error) and add a space and save it to force clear the cache. Sometimes it a single file or 2 files, but sometimes there are 10 files.
So, would like to know what's the right/recommended way to clear the razor file cache whenever we find this problem again.