While building service fabric the package command runs file in local machine, but fails when this is added as a build steps in TFS/VSTS. We are using onPrem build agent.
dotnet msbuild DependentServices.sfproj /t:Package
It throws error:
The process cannot access the file 'D:\TFS BuildAgent\BuildAgent4_work\4\s\CommonLibraries\Model.dll' because it is being used by another process.
\CommonLibraries\Model.dll
being generated during your build? – Daniel Mann