dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.21k stars 1.35k forks source link

Error CS2012 #3343

Open Claytonator opened 6 years ago

Claytonator commented 6 years ago

Hi, randomly I get this error when queue the building with /m option

We have a TFS 2017 and privated hosted agents pool. The versión of the hosted agents are 2.122.1

Visual Studio 2015

How we can avoid this problema, running the build in multicpu option.

Thanks so much.

Error:

CSC (0, 0)

CSC(0,0): Error CS2012: Cannot open 'D:\Builds\1\2\s\Units\Utilities\Source\UnitTesting\obj\Debug\Example.Comit.Utilities.UnitTesting.dll' for writing -- 'Access to the path 'D:\Builds\1\2\s\Units\Utilities\Source\UnitTesting\obj\Debug\Example.Comit.Utilities.UnitTesting.dll' is denied.'

Process 'msbuild.exe' exited with code '1'.

AsherKa commented 6 years ago

I'm also facing the same issue and it's quite frustrating, to be honest... Eventually, I had to disable the /m switch to make the issue go away but it is clearly not a proper solution.

Can someone please help sort this issue and get it resolved? There are tons of such issues online without a solution.