Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Dot Net 9? #872

Open
aaronportier opened this issue Nov 27, 2024 · 3 comments
Open

Compatibility with Dot Net 9? #872

aaronportier opened this issue Nov 27, 2024 · 3 comments

Comments

@aaronportier
Copy link

Updates DotNet to DotNet 9 and Appium WebDriver and a few other packages needed me to be at Dot Net 9. I am seeing this issue now:

When running I get this issue: I did update everything including the HarmonyLib.

OneTimeSetUp: System.TypeInitializationException : The type initializer for '<Module>' threw an exception.

----> HarmonyLib.HarmonyException : Patching exception in method System.Void OpenQA.Selenium.Remote.HttpCommandExecutor::.ctor(System.Uri addressOfRemoteServer, System.TimeSpan timeout, System.Boolean enableKeepAlive)
----> System.MemberAccessException : Cannot create an instance of System.Reflection.Emit.LocalBuilder because it is an abstract class.

Stack Trace: 


RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
--HarmonyException
PatchClassProcessor.ReportException(Exception exception, MethodBase original)
PatchClassProcessor.Patch()
<>c.b__12_1(PatchClassProcessor patchClass)
CollectionExtensions.Do[T](IEnumerable1 sequence, Action1 action)
CollectionExtensions.DoIf[T](IEnumerable1 sequence, Func2 condition, Action1 action) Harmony.PatchAllUncategorized(Assembly assembly) BrowserstackPatcher.DoPatching() Initializer.Run() cctor() --MemberAccessException RuntimeConstructorInfo.CheckCanCreateInstance(Type declaringType, Boolean isVarArg) RuntimeConstructorInfo.ThrowNoInvokeException() RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ConstructorInfo.Invoke(Object[] parameters) CecilILGenerator.DeclareLocal(Type localType, Boolean pinned) CecilILGenerator.DeclareLocal(Type localType) ILGeneratorProxy.DeclareLocal(Type) MethodPatcher.DeclareLocalVariable(Type type, Boolean isReturnValue) MethodPatcher.CreateReplacement(Dictionary2& finalInstructions)
PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
PatchClassProcessor.ProcessPatchJob(Job job)

@aaronportier
Copy link
Author

When I try to go to DotNet 8 I get this message. System.NotSupportedException : JsonTypeInfo metadata for type 'System.Text.Json.JsonElement' was not provided by TypeInfoResolver of type 'OpenQA.Selenium.CommandJsonSerializerContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically. The unsupported member type is located on type 'System.Object'. Path: $.
----> System.NotSupportedException : JsonTypeInfo metadata for type 'System.Text.Json.JsonElement' was not provided by TypeInfoResolver of type 'OpenQA.Selenium.CommandJsonSerializerContext'. If using source generation, ensure that all root types passed to the serializer have been annotated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.

@Dor-bl
Copy link
Collaborator

Dor-bl commented Dec 4, 2024

@aaronportier Which selenium dependency version are you using?
please provide a short snippet of your code to reproduce the issue
@nvborisenko FYI

@aaronportier
Copy link
Author

I reverted back the Appium Webdriver 6.0.1 back to 6.0.0 with it Selenium 4.25.0 and it resolved the issue. It is giving me the 'System.Text.Json.JsonElement' when I install the 6.0.1 and with it installs Selenium 4.26.1. All my code is tightly integrated into BrowserStack so it will not work the same for you because mine goes to that Cloud Provider and installs the app. Is there a helpful log I could give you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants