I am running VS2017 version 26430.13 and every time I try to build a web project I get errors that access to the files in the bin\\roslyn is denied. Over a period of about 5 mi
Instead of killing the process manually, you may use the following commands in a Pre-Build Event:
tasklist /FI "IMAGENAME eq VBCSCompiler.exe" 2>NUL | find /I /N "VBCSCompiler.exe">NUL
if "%ERRORLEVEL%"=="0" (taskkill /IM VBCSCompiler.exe /F) else (verify >NUL)
Microsoft.CodeDom.Providers.DotNetCompilerPlatform
package to V1.0.4
This advice came from a comment on the developer community problem report https://developercommunity.visualstudio.com/solutions/79954/view.html.
We were on v1.0.5 and experienced locked files frequently. After reverting the Microsoft.CodeDom.Providers.DotNetCompilerPlatform package to V1.0.4 we are no longer experiencing locked files.
A workaround is close VS, open task manager and kill any instances of VBCSCompiler.exe
(Thanks Tom John: https://developercommunity.visualstudio.com/content/problem/71302/binroslyn-files-locked-during-build.html)
For me I just open solution in file explorer and delete bin folders of all projects in it. now it's working fine.
Project > Manage NuGet Packages... > Installed(tab) > in search input set this:
codedom
click to update
In my case I did these two steps: