6

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.

bomaboom
  • 190
  • 1
  • 14
  • Is `\CommonLibraries\Model.dll` being generated during your build? – Daniel Mann Feb 10 '19 at 00:06
  • yes it is generated. but the build is a different step before package. – bomaboom Feb 11 '19 at 02:32
  • you command is looking somewhat weird? is it a single command or two commands? – 4c74356b41 Feb 12 '19 at 05:54
  • When you say the build and package are in different "step" you're saying they are different tasks in the same job, correct? If they are in different jobs, then you **may** need to make sure they are running in sequence and not in parallel. [Build jobs run in parallel by default](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/multiple-phases?view=azure-devops&tabs=designer#dependencies). – Josh Gust Feb 12 '19 at 23:17
  • Yes they are different steps in the same job. But I have 3 projects/application to package and they are using same common dlls. – bomaboom Feb 14 '19 at 00:59

1 Answers1

2

Did you try suggestions from this article Troubleshoot Build and Release: File- and folder-in-use errors? Sections: Detect files and folders in use and Anti-virus exclusion

Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31