I've had a Visual Studio 2017 file locking issue on my local PC that has been pissing me off recently. It seems to happen after I've rebased and then tried to recompile my solution. Visual Studio complains that it can't compile the solution because the 'roslyn' folder within the 'bin' folder is locked. See the beautiful error message below:
The obvious solution is to try and delete the folder, however, if you try to delete it, Windows moans the file is locked. I use a file unlock program called LockHunter' and that doesn't always fix it. I also tried shutting down my solution with no luck. I also closed VS without the issue going away!!! After some research and Googling, I have found a fix. In Task Explorer, find the 'VBCSCompiler.exe' process(es) and KILL IT(them).
Job Done! Happy Coding 🤘