Access to the path denied with MAUI and ChromeDriver

Rolandas Vegis 1 Reputation point
2022-07-04T10:04:07.637+00:00

Hello, I had a winforms app which I am considering porting to MAUI. The app uses Selenium ChromeDriver.

The following line: new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
Gives the exception: "System.UnauthorizedAccessException: 'Access to the path 'C:\WINDOWS\system32\Chrome\103.0.5060.53\X64' is denied.'"

It works fine on winforms app.

Are there capabilities or something which should be added to the app?
Could anyone point me in the right direction?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
34,864 questions
{count} votes

1 answer

Sort by: Most helpful
  1. mahdi dadgarpour 1 Reputation point
    2022-09-26T20:51:17+00:00

    First, install the WebDriverManager package
    Next:

    using WebDriverManager.DriverConfigs.Impl;
    using WebDriverManager.Helpers;
    using WebDriverManager;

    new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
    var chromeDriverService = ChromeDriverService.CreateDefaultService();
    ChromeOptions options = new ChromeOptions();
    driver = new ChromeDriver(chromeDriverService, options);

    0 comments No comments