I\'ve been having this problem for a while now. I created a brand new winforms c# application in Visual Studio. I can usually launch it in debug mode once without a problem.
I've been experiencing this problem now for the last 9 months, in VS2015 and VS2017 community editions. It appears that the compiler continues to live after the first compile for about 20 minutes, all the while holding locks on the files.
My workaround is to kill the compiler, then rebuild. This always works without any apparent adverse side effects.
You can kill the compiler from the Package Manager Console (or from PowerShell) with this code:
Get-Process | where {$_.ProcessName -eq "VBCSCompiler"} | foreach {Stop-Process -Id $_.Id}
Hope this helps you as it has me for the past couple of months.