If you rebuild a project in Visual studio, you can get access denied to the path Bin\Roslyn for various dlls, as per the below example:
Access to the path ‘bin\roslyn\System.Security.Cryptography.Primitives.dll’ is denied.
To fix this, you can do various things like try to kill the compiler process so it can restart, etc. But the easiest way to fix this is just a quick reboot of the computer.