Question: Suddenly I cannot rebuild my project in VS 2017. I get these messages:

`1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4222,5): error MSB3021: Unable to copy file "C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.1.0\FSharp.Core.dll" to "bin\Debug\FSharp.Core.dll". Access to the path 'bin\Debug\FSharp.Core.dll' is denied.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4222,5): error MSB3021: Unable to copy file "H:\Dropbox\BitBucket\VSProjects\Fractal10\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" to "bin\Debug\Newtonsoft.Json.dll". Access to the path 'bin\Debug\Newtonsoft.Json.dll' is denied.`

Any suggestions on how to solve this problem?

Answer: 
Possible causes:

* The app you are trying to build/debug can be running or stuck open
* Tests locking the assemblies could be using them
* post-build steps listed in the properties page of a project could be using them
* while building multiple projects in parallel: another project could have decided to use those `dll` in the output folder for those references
* Visual Studio's F# interactive if set to not shadow copy assemblies could cause it.
* anything else that causes a file to be locked in windows
It happened today for me, I had pulled a branch from git repo and the project was not getting compiled or cleaned.

I had to uncheck read-only option for the root directory and the nested files & folders of the root directory.

Go to the folder where the project is, right click on the directory, click properties, Uncheck Read-only option.

[![Image](https://i.stack.imgur.com/GVQhT.png)](https://i.stack.imgur.com/GVQhT.png)