Horusiath / Akkling

Experimental F# typed API for Akka.NET
Apache License 2.0
226 stars 44 forks source link

Hyperion.SerializerOptions exception #118

Open jmnowick opened 5 years ago

jmnowick commented 5 years ago

Trying to run the most basic example and I get an exception as follows.

"The type initializer for 'Hyperion.SerializerOptions' threw an exception."

running Akka 1.3.13 Akkling 0.93 which has Akka.Serialization.Hyperion 1.3.8-beta66 hyperion 0.98

Horusiath commented 5 years ago
  1. Is that the entire exception message?
  2. Are you sure that all packages and assemblies are in place? I remember that using nuget for resolving packages didn't load all dependecies (I think that Hyperion package itself was missing), however it works fine with Paket.
chnlkw commented 5 years ago

i met the same exception when i use akkling to creating the actor system. I have the same package version as @jmnowick . I use Visual Studio 2019 with dotnet core 3.0-preview-6

open Akka.FSharp
open Akkling

use system = Akka.FSharp.System.create "system-create" (Akka.FSharp.Configuration.load()) // 1. success
use system = Akka.FSharp.System.create "system-create" ( Configuration.defaultConfig() ) // 2. fail
use system = System.create "my-system" <| Configuration.defaultConfig() // 3. fail 

The exception of 2 and 3 are same below:

Result StackTrace:  
at Hyperion.SerializerOptions..ctor(Boolean versionTolerance, Boolean preserveObjectReferences, IEnumerable`1 surrogates, IEnumerable`1 serializerFactories, IEnumerable`1 knownTypes, Boolean ignoreISerializable)
   at Akka.Serialization.HyperionSerializer..ctor(ExtendedActorSystem system, HyperionSerializerSettings settings)
   at Akka.Serialization.HyperionSerializer..ctor(ExtendedActorSystem system)
----- Inner Stack Trace -----
   at Hyperion.SerializerFactories.ExceptionSerializerFactory..ctor()
   at Hyperion.SerializerOptions..cctor()
----- Inner Stack Trace -----
   at System.Reflection.TypeExtensions.GetMethod(Type type, String name, BindingFlags bindingAttr)
   at Hyperion.SerializerFactories.ExceptionSerializerFactory..cctor()
Result Message: 
System.TypeInitializationException : The type initializer for 'Hyperion.SerializerOptions' threw an exception.
---- System.TypeInitializationException : The type initializer for 'Hyperion.SerializerFactories.ExceptionSerializerFactory' threw an exception.
-------- System.ArgumentNullException : Value cannot be null.
Parameter name: type
jmnowick commented 5 years ago

Update. If I target SDK to 2.2 everything works fine.