6
votes

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.

1
Is \CommonLibraries\Model.dll being generated during your build?Daniel Mann
yes it is generated. but the build is a different step before package.bomaboom
you command is looking somewhat weird? is it a single command or two commands?4c74356b41
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.Josh Gust
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

1 Answers

2
votes

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