admin管理员组

文章数量:1122832

I have a pipeline for an onprem agent. This is a .Net 8 web application.

I'm getting very inconsistent results. Every once in a while I get a completed build. Most of the time I'm getting a message like this:

2024-11-21T14:22:31.2057311Z   Restored E:\agent\_work\57\s\foo\source\ABC\TOPImportService\ABC.TOPImportService.csproj (in 192 ms).
2024-11-21T14:22:31.7260950Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.Core\ABC.Core.csproj (in 737 ms).
2024-11-21T14:22:31.7261477Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\XYZ.Notification\XYZ.Notification.csproj (in 496 ms).
2024-11-21T14:22:32.6002407Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.PersistenceService\ABC.PersistenceService.csproj (in 856 ms).
2024-11-21T14:22:33.5381732Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.Infrastructure\ABC.Infrastructure.csproj (in 2.53 sec).
2024-11-21T14:22:33.6414945Z   Restored E:\agent\_work\57\s\foo\source\ABC\TOPImportWorkerService\ABC.TOPImportWorkerService.csproj (in 2.63 sec).
2024-11-21T14:22:33.7495891Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.Web\ABC.Web.csproj (in 2 sec).
2024-11-21T14:22:40.7093178Z C:\Program Files\dotnet\sdk\8.0.403\Microsoft.Common.CurrentVersion.targets(4857,5): warning MSB3026: Could not copy "obj\Release\net8.0\XYZ.Notification.dll" to "bin\Release\net8.0\XYZ.Notification.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'E:\agent\_work\57\s\foo\source\ABC\src\XYZ.Notification\obj\Release\net8.0\XYZ.Notification.dll' because it is being used by another process.  [E:\agent\_work\57\s\foo\source\ABC\src\XYZ.Notification\XYZ.Notification.csproj]

The 'file in use' often changes. Sometimes it is multiple files.

Also - I'm not sure if it is trying to WRITE to the source folder (which wouldn't make sense to me).

I have a pipeline for an onprem agent. This is a .Net 8 web application.

I'm getting very inconsistent results. Every once in a while I get a completed build. Most of the time I'm getting a message like this:

2024-11-21T14:22:31.2057311Z   Restored E:\agent\_work\57\s\foo\source\ABC\TOPImportService\ABC.TOPImportService.csproj (in 192 ms).
2024-11-21T14:22:31.7260950Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.Core\ABC.Core.csproj (in 737 ms).
2024-11-21T14:22:31.7261477Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\XYZ.Notification\XYZ.Notification.csproj (in 496 ms).
2024-11-21T14:22:32.6002407Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.PersistenceService\ABC.PersistenceService.csproj (in 856 ms).
2024-11-21T14:22:33.5381732Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.Infrastructure\ABC.Infrastructure.csproj (in 2.53 sec).
2024-11-21T14:22:33.6414945Z   Restored E:\agent\_work\57\s\foo\source\ABC\TOPImportWorkerService\ABC.TOPImportWorkerService.csproj (in 2.63 sec).
2024-11-21T14:22:33.7495891Z   Restored E:\agent\_work\57\s\foo\source\ABC\src\ABC.Web\ABC.Web.csproj (in 2 sec).
2024-11-21T14:22:40.7093178Z C:\Program Files\dotnet\sdk\8.0.403\Microsoft.Common.CurrentVersion.targets(4857,5): warning MSB3026: Could not copy "obj\Release\net8.0\XYZ.Notification.dll" to "bin\Release\net8.0\XYZ.Notification.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'E:\agent\_work\57\s\foo\source\ABC\src\XYZ.Notification\obj\Release\net8.0\XYZ.Notification.dll' because it is being used by another process.  [E:\agent\_work\57\s\foo\source\ABC\src\XYZ.Notification\XYZ.Notification.csproj]

The 'file in use' often changes. Sometimes it is multiple files.

Also - I'm not sure if it is trying to WRITE to the source folder (which wouldn't make sense to me).

Share Improve this question asked Nov 21, 2024 at 14:39 user2912826user2912826 531 silver badge4 bronze badges 3
  • Please clarify in details what "The 'file in use' often changes." you mean. Besides, please share the completed yaml file of your pipeline. – Ziyang Liu-MSFT Commented Nov 22, 2024 at 1:27
  • In the error above, the file in use is: The process cannot access the file 'E:\agent_work\57\s\foo\source\ABC\src\XYZ.Notification\obj\Release\net8.0\XYZ.Notification.dll' because it is being used by another process. In other runs (no code changes, same build agent) - the 'file in use' is a different file from the source code. – user2912826 Commented Nov 25, 2024 at 14:11
  • Please delete the obj and bin folders in your self-hosted agent folder E:\agent\_work\57\s\foo\source\ABC\src\XYZ.Notification, then rebuild the project and check if it works. To narrow down the issue, try to run the pipeline using a Microsoft-hosted agent, if it works, we can know the issue is related to the self-hosted agent or the local environment. – Ziyang Liu-MSFT Commented Nov 26, 2024 at 7:34
Add a comment  | 

1 Answer 1

Reset to default 0

I changed publishWebProjects from 'false' to 'true' and the intermittent errors went away.

本文标签: azure devopsInconsistent build behaviorStack Overflow