Skip to content

Broken on .NET 9 #25

@th0mk

Description

@th0mk

Since upgrading my project to .NET 9, I get the following error:

Jil.DeserializationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.TypeInitializationException: The type initializer for 'Jil.Deserialize.InlineDeserializer`1' threw an exception.
 ---> System.Reflection.AmbiguousMatchException: Ambiguous match found for 'System.TimeSpan System.TimeSpan FromSeconds(Int64)'.
   at System.RuntimeType.GetMethodImplCommon(String name, Int32 genericParameterCount, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)
   at System.Type.GetMethod(String name, BindingFlags bindingAttr)
   at Jil.Deserialize.InlineDeserializer`1..cctor()
   --- End of inner exception stack trace ---
   at Jil.Deserialize.InlineDeserializer`1.AddGlobalVariables()
   at Jil.Deserialize.InlineDeserializer`1.BuildWithNew(Type forType)
   at Jil.Deserialize.InlineDeserializer`1.BuildWithNewDelegate(Int32& approximateILCount)
   at Jil.Deserialize.InlineDeserializerHelper.BuildFromStream[ReturnType](Type optionsType, DateTimeFormat dateFormat, SerializationNameFormat serializationNameFormat, Exception& exceptionDuringBuild)
   at Jil.Deserialize.TypeCache`2.Load()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Jil.Deserialize.InlineDeserializer`1.FindAndPrimeIndirectTypes(Type forType)
   at Jil.Deserialize.InlineDeserializer`1.BuildWithNewDelegate(Int32& approximateILCount)
   at Jil.Deserialize.InlineDeserializerHelper.BuildFromStream[ReturnType](Type optionsType, DateTimeFormat dateFormat, SerializationNameFormat serializationNameFormat, Exception& exceptionDuringBuild)
   at Jil.Deserialize.TypeCache`2.Load()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Jil.Deserialize.InlineDeserializer`1.FindAndPrimeIndirectTypes(Type forType)
   at Jil.Deserialize.InlineDeserializer`1.BuildWithNewDelegate(Int32& approximateILCount)
   at Jil.Deserialize.InlineDeserializerHelper.BuildFromStream[ReturnType](Type optionsType, DateTimeFormat dateFormat, SerializationNameFormat serializationNameFormat, Exception& exceptionDuringBuild)
   at Jil.Deserialize.TypeCache`2.Load()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Jil.Deserialize.InlineDeserializer`1.FindAndPrimeIndirectTypes(Type forType)
   at Jil.Deserialize.InlineDeserializer`1.BuildWithNewDelegate(Int32& approximateILCount)
   at Jil.Deserialize.InlineDeserializerHelper.BuildFromStream[ReturnType](Type optionsType, DateTimeFormat dateFormat, SerializationNameFormat serializationNameFormat, Exception& exceptionDuringBuild)
   at Jil.Deserialize.TypeCache`2.Load()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Jil.Deserialize.InlineDeserializer`1.FindAndPrimeIndirectTypes(Type forType)
   at Jil.Deserialize.InlineDeserializer`1.BuildWithNewDelegate(Int32& approximateILCount)
   at Jil.Deserialize.InlineDeserializerHelper.BuildFromStream[ReturnType](Type optionsType, DateTimeFormat dateFormat, SerializationNameFormat serializationNameFormat, Exception& exceptionDuringBuild)
   at Jil.Deserialize.TypeCache`2.Load()
   at Jil.Deserialize.TypeCache`2.Get()
   at Jil.JSON.Deserialize[T](TextReader reader, Options options)
   --- End of inner exception stack trace ---
   at Jil.JSON.Deserialize[T](TextReader reader, Options options)
   at Genius.Clients.SearchClient.Search(String query)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions