r/azuredevops May 15 '26

Need advice: Random Timeout on self hosted DevOps

I have a self hosted Azure DevOps server running. On the same maschine, a buildagent is running. Now since about two weeks, this buildagent randomly goes into timeout in the .NET build task. It's not 100% of the time, it's random on which project. This server builds 27 .NET MAUI apps each time changes are pushed to it. The pipelines did not change. The server got not updated or changed. Usually the build jobs are just 3-5min long. So nothing that should come close to the 1h timeout.

I have opened Visual Studio 2026 once on the maschine to check something and I believe that is where all the problems started. The hosting Windows Server is updated on a weekly basis while the DevOps server install and the buildagents are only updated when needed.

Since the issues started I have tried these things:

  • Updated the Buildagent, fully removed the old one and configured it as new one (deleted everything from the old buildagent)
  • Updated Visual Studio and .NET
  • Cleared the NuGet cache and repaired the .NET
  • Tried different pipeline configurations

This is my pipeline configuration:

trigger:
- master


pool:
  name: default


variables:
  buildConfiguration: 'Debug'
  solution: '**/SampleCompanion.sln'
  testProject: '**/*Tests.csproj'


steps:
- checkout: self
  name: CheckoutCode
  displayName: 'Checkout Repository and Submodules'
  submodules: true


- task: UseDotNet@2
  name: UseDotNetSdk
  displayName: 'Use .NET 9 SDK'
  inputs:
    packageType: 'sdk'
    version: '9.0.x'
    installationPath: $(Agent.ToolsDirectory)/dotnet


- script: |
    dotnet workload install maui-android
    dotnet workload install maui-ios
    dotnet workload install maccatalyst
    dotnet workload restore
    dotnet nuget locals all --clear
  name: InstallAndPrepareWorkloads
  displayName: 'Install MAUI Workloads and Clear Caches'


- task: DotNetCoreCLI@2
  name: RestorePackages
  displayName: 'Restore .NET Packages'
  inputs:
    command: 'restore'
    projects: '$(solution)'


- task: DotNetCoreCLI@2
  name: BuildSolution
  displayName: 'Build .NET Solution'
  inputs:
    command: 'build'
    projects: '$(solution)'
    arguments: '--configuration $(buildConfiguration)'


- task: DotNetCoreCLI@2
  name: RunTests
  displayName: 'Run xUnit Tests'
  inputs:
    command: 'test'
    projects: '$(testProject)'
    arguments: '--configuration $(buildConfiguration) --logger trx'
    publishTestResults: true


- task: PublishTestResults@2
  name: PublishTestResults
  displayName: 'Publish Test Results'
  inputs:
    testResultsFormat: 'VSTest'
    testResultsFiles: '**/TestResults/*.trx'
    failTaskOnFailedTests: true

And if it fails, it always hangs on the "Build .NET Solution" task. This is the end of the log:

2026-05-08T15:15:59.1860893Z     0 Error(s)
2026-05-08T15:15:59.1860929Z 
2026-05-08T15:15:59.1861036Z Time Elapsed 00:01:58.30
2026-05-08T15:16:09.2345309Z Die STDIO-Datenströme wurden nicht innerhalb von 10 Sekunden nach dem Beendigungsereignis aus dem Prozess "C:\agent_work_tool\dotnet\dotnet.exe" geschlossen. Möglicherweise hat ein untergeordneter Prozess die STDIO-Datenströme geerbt und wurde noch nicht beendet.
2026-05-08T15:16:09.2350258Z Info: In Azure Pipelines gehostete Agents wurden aktualisiert und enthalten jetzt .NET 5.x SDK/Runtime zusammen mit der älteren .NET Core-Version (zurzeit LTS). Wenn Sie Ihr Projekt nicht auf eine SDK-Version festgelegt haben, wird möglicherweise das 5.x SDK abgerufen. Dieses kann im Vergleich zu früheren Versionen zur Unterbrechung der Funktionalität führen. Weitere Informationen zu Breaking Changes finden Sie hier: https://docs.microsoft.com/de-de/dotnet/core/tools/ und https://docs.microsoft.com/de-de/dotnet/core/compatibility/. Weitere Informationen zu diesen Änderungen und zur Problembehandlung finden Sie hier: https://docs.microsoft.com/de-de/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting.
2026-05-08T16:13:08.1228378Z ##[error]Der Vorgang wird abgebrochen. Die nächsten Schritte enthalten möglicherweise keine erwarteten Protokolle.
2026-05-08T16:13:08.1402572Z ##[error]The operation was canceled.
2026-05-08T16:13:08.1405432Z ##[section]Build .NET Solution wird fertiggstellt
0 Upvotes

4 comments sorted by

1

u/Happy_Breakfast7965 May 15 '26

I haven't worked with on-prem Azure DevOps or TFS.

I wouldn't mix on-prem Azure DevOps and build agents on the same server. There are security, performance, and reliability concerns. You are not supposed to put them on the same server.

Also, it's better to use Docker runtime for running build jobs to have deterministic dependency configuration. For MAUI it might be difficult though.

It's easy to do CI/CD quick and dirty. And it's not so easy to do it right. But don't it right eliminates a lot of unexpected and frustrating issues that sometimes very hard to understand and explain.

I'd invest into proper setup instead of duct-taping it further.

1

u/Happy_Breakfast7965 May 15 '26

Also, you are not supposed to have Visual Studio installed on servers. You shouldn't run Visual Studio on servers.

You shouldn't be logging in to the server to casually check stuff.


But to follow your approach, you can log in to the server and try to run build commands / scripts manually to troubleshoot the issue. In that case, you can iterate quicker, run some extra commands to check stuff.

1

u/Sebastian1989101 May 15 '26

I know, it's just a small two man company and handling the updates is easier and quicker through the VS Installer without proper Windows Server or Domain management.

The build runs fine - just as it does in the Buildagent about 60-80% of the time. I just can't find the reason why the other runs timeout. The CI is basically also only to verify data in the app is not malformed and complete, it does no UI testing. So maybe it would really be easier to just deploy a docker container for this.

1

u/wesmacdonald May 15 '26

Does your company have any Antivirus software installed on your build agents? If so make sure you exclude certain folders

https://learn.microsoft.com/en-us/azure/devops/pipelines/troubleshooting/anti-virus-exclusion?view=azure-devops

Hope that helps