On the client, queued builds get stuck on the queue and never start.
On the server, build service is running, but both the Build Controller and Build Agent appear as ‘Ready’ with ‘Stopped’ icon.
After more digging, the Build-Services\Operational event viewer log revealed the reason:
Build machine build lost connectivity to message queue tfsmq://buildservicehost-2/.
Reason: Please contact your administrator. There was an error contacting the server.
Technical information (for administrator):
HTTP code 500: System.ServiceModel.ServiceActivationException
TFS was running in SSL binding but the build service was failing to bind. First, we need to make sure the Message Queue is configured with httpsTransport binding by modifying the web.config on the App Tier under:
C:\Program Files\Microsoft Team Foundation Server 11.0\Application Tier\Message Queue\web.config
<textMessageEncoding messageVersion="Soap12WSAddressing10" />
<httpsTransport authenticationScheme="Ntlm" manualAddressing="true" />
Restart IIS (iisreset) and restart the build service.