I feel guilty asking a question like this around here, but I\'m at a loss and would appreciate some help.
A proof-of-concept like web application was built on one PC
In my case, the solution was:
Use Windows Explorer and navigate to the offending path: C:\MyApplication\Code\Main\ABCProject\ABCProject.UI\Bin
Right click on bin folder > select properties > Uncheck ReadOnly.
I moved my solution from one drive to another, and one of the files could not be copied because "in used", for which I click ignored, producing the error described in this post. Copying the missing file manually fixed it.
file: Microsoft.Build.Tasks.CodeAnalysis.dll Destination directory: packages\Microsoft.Net.Compilers.2.1.0\tools
I delete all from packages folder and rebuild solution. It's worked for me.
I just tried this on a clean install of a Windows 10 machine and the issue for me ended up being that I didn't have the .NET 3.5 framework installed. This stackoverflow question helps explain why.
Cannot build WIX project on windows 10
I too tried the top answer with no luck so deleted the contents of my bin and packages dir, closed and re-opened VS and everything fine now.
It turns out that NuGet packages were committed to the repository and breaking everything. Deleting the project\project\packages directory from the repo solved all build problems since NuGet fetches the packages automatically on build.