using OpenQA.Selenium.Firefox;
If Firefox itself is not installed properly, geckodriver can’t start.
If a previous debug session crashed, a "ghost" instance of GeckoDriver might still be holding onto the port. Open . End all tasks named geckodriver.exe . End all tasks named firefox.exe . 📋 Best Practices for C#
When you see "cannot start the driver service on http://localhost" , run through this checklist in order: