So i have made an application that invokes code for WebDriverManager (selenium), and when i debug it in studio it works fine, but if i publish it to orchestrator and run it on my robot i get the below error:
RemoteException wrapping System.TypeInitializationException: The type initializer for ‘WebDriverManager.Clients.ChromeForTestingClient’ threw an exception. —> RemoteException wrapping System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral
It makes no sense since it should be using 7.0.3, which is the newest version installed from the package webdrivermanager, but it looks for 7.0.0 for some reason. I figured this might be related to Office365 activities, but i can’t find anyone who have the same error for 7.0.0, in a windows project.
I’ve tried installing System.Text.Json version 7.0.3 (it won’t let me install 7.0.0 due to webdrivermanager using a newer version), but that doesn’t help, neither does importing it to the namespace. I’ve tried a bunch of things with no luck, so i’m hoping i can get some help here. It seems to be a bug that also appears in visual studio. FileLoadException with System.Text.Json
when upgrading to v2.17.0 · Issue #257 · rosolko/WebDriverManager.Net (github.com)
I hoped it was due to our robot only being 2022.4.X, so i downgraded Mail Activities to 1.18.2 and Office365 to 1.14.1 to match the UiPath.platform which took a hell of a time because the activities changed in newer versions, so i had to rebuild it all, and it still didn’t work…
Here are my dependencies:
"EPPlus": "[6.2.10]",
"ExcelDataReader": "[3.6.0]",
"ExcelDataReader.DataSet": "[3.6.0]",
"Selenium.Support": "[4.10.0]",
"Selenium.WebDriver": "[4.10.0]",
"System.Text.Json": "[7.0.3]",
"UiPath.Excel.Activities": "[2.22.2]",
"UiPath.Mail.Activities": "[1.18.2]",
"UiPath.MicrosoftOffice365.Activities": "[1.14.1]",
"UiPath.System.Activities": "[23.4.5]",
"UiPath.Testing.Activities": "[23.4.1]",
"UiPath.UIAutomation.Activities": "[23.4.8]",
"WebDriverManager": "[2.17.1]"