When you see "Cannot start the driver service on http://localhost" , follow this sequence:
Update your NuGet packages to Selenium.WebDriver 4.6 or higher.
The .../localhost part is not the problem—it is simply the address Selenium attempted to bind to. The real issue lies that point.
Selenium attempts to launch Firefox from standard paths (e.g., C:\Program Files\Mozilla Firefox\firefox.exe on Windows, /usr/bin/firefox on Linux). If Firefox is installed in a non-standard location, GeckoDriver cannot start it.
pkill -f geckodriver