I have managed to reproduce problem on another computer that i was going to reinstall anyway. Here are steps i did.
NOTE: In my case, doing these steps was not reversible. A full re-install of windows was required to fix it after following these steps.
- Press Windows Start Button
- Search for Windows Features
- Click on Turn Windows features on or off
- Find .NET Framework 4.5 / 4.6 and expand everything in it
- Inside WCF Services, there should be a ticked box: TCP Port Sharing untick this, and Swarm Agent will get same error. However, I was unable to recheck this, in my case after checking it and pressing OK, i was prompted with an Installation Failed.
Those were steps i did to reproduce issue. I hope these might help for future troubleshooting, or help with a workaround for this, i hardly think its a common problem however, but in my case Swarm Agent stopped working when TCP Port Sharing was Not ticked.