Immutable solution version
Dotnet Error in 4.11.0 when using ChromeDriverService.CreateDefaultService()
Complete solution
Shows how to fix dotnet Error in 4.11.0 when using ChromeDriverService.CreateDefaultService(). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For "Unable to obtain chrome using Selenium Manager": what works: Upgrade to Selenium 4.12 or newer. In 4.11 the.NET Service constructor treated a path without a trailing slash as a file instead of a directory, which broke ChromeDriverService.CreateDefaultService(); that was fixed for 4.12.
Unable to obtain chrome using Selenium ManagerSteps
- What works:
Upgrade to Selenium 4.12 or newer. In 4.11 the .NET Service constructor treated a path without a trailing slash as a file instead of a directory, which broke ChromeDriverService.CreateDefaultService(); that was fixed for 4.12. From 4.11 on, you also do not need to manage drivers yourself: drop the manual service creation and let Selenium Manager download the driver.
- If you unpack the NuGet by hand for PowerShell use, keep the layout intact:
selenium-manager.exegoes inselenium-manager/windows/next toSelenium.WebDriver.dll, and dependency DLLs likeNewtonsoft.Jsonmust sit beside the WebDriver DLL. A user confirmed the exact failing script worked after these fixes.
When to use
You are seeing this: What was reported: Issue SeleniumHQ/selenium#12564 (closed, 46 comments): ### What happened? Use this skill when you run into "Dotnet Error in 4.11.0 when using ChromeDriverService.CreateDefaultService()".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 4.11.0, 4.10.0. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://www.nuget.org/packages/Selenium.Support/
- https://www.nuget.org/packages/Selenium.WebDriver
Evidence
In the GitHub issue, the reporter asked: Dotnet Error in 4.11.0 when using ChromeDriverService.CreateDefaultService(). The working answer that came out of the thread: Upgrade to Selenium 4.12 or newer. In 4.11 the .NET Service constructor treated a path without a trailing slash as a file instead of a directory, which broke ChromeDriverService.CreateDefaultService(); that was fixed for 4.12. From 4.11 on, you also do not need to manage drivers yourself: drop the manual service creation and let Selenium Manager download the driver.
If you unpack the NuGet by hand for PowerShell use, keep the layout intact: selenium-manager.exe goes in selenium-manager/windows/ next to Selenium.WebDriver.dll, and dependency DLLs like Newtonsoft.Json must sit beside the WebDriver DLL. A user confirmed the exact failing script worked after these fixes. Source: https://github.com/SeleniumHQ/selenium/issues/12564
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_ymQDUKEIRPDYG4QMBjjpcQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Dotnet Error in 4.11.0 when using ChromeDriverService.CreateDefaultService() <span>— Vectle</span></a>