could not load system.text.json

197 views
Skip to first unread message

bjm3...@gmail.com

unread,
Sep 1, 2024, 5:51:10 AM9/1/24
to Selenium Users
Hello
Visual studio 2022, programming in VBA, Nuget for managing selenium libraries.

All selenium calls happen in a DLL that I called JIE_DLL.
I had not used it for some time.
First I updated Selenium packages using Nuget. To do this I open solely the DLL in VStudio and do "Manage Nuget packages" in the Solution explorer for the DLL only. I I update packages in the project, Nuget creates "packages" folders in other places.
All packages (including system.text.json) are in JIE_DLL.packages
I also have a reference to system.text.json/8.0.4/lib/net462  in the DLL references (it is not necessary for compiling)

Then I reopen the project that uses JIE DLL Rebuild solution and it compiles OK.
But when I run the project, the browser does not open. I can see the command window of the driver opening but it closes immediately and raises an error.

the line that raises the error
      oChromeDriver = New SCR.ChromeDriver(Driver.Path, oCRoptions, tTimeOut)      ' launch Driver and navigator

the error
"Could not load file or assembly 'System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified."
   at OpenQA.Selenium.Command.get_ParametersAsJsonString()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.HttpRequestInfo..ctor(Uri serverUri, Command commandToExecute, HttpCommandInfo commandInfo)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.<ExecuteAsync>d__34.MoveNext()

I have tried to remove all packages and let Nuget recreate them but this does not help.
Can somebody help me on this ?
Thanks in advance

download Selenium

unread,
Sep 2, 2024, 11:53:29 PM9/2/24
to Selenium Users
I answer my own question since I solved it this morning.
I confused the microsoft text.json and the Nuget text.json
Sorry

Reply all
Reply to author
Forward
0 new messages