System.IO.FileLoadException : The given assembly name or codebase was invalid

1

Hi has anyone had their actorsystem crash with a bad config string? I was given

System.IO.FileLoadException : The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

so it seems that it cannot resolve a typename using my config string. here it is:

akka {
loglevel=WARNING,
loggers=[""
Akka.Logger.Serilog.SerilogLogger,
Akka.Logger.Serilog,
Akka.TestKit.TestEventListener,
Akka.TestKit""]}

Im not sure what im doing wrong since serilog and testkit all are installed.

Here is the full stack trace.

.net
akka.net
asked on Stack Overflow Feb 6, 2019 by Samuel J

1 Answer

1

akka.loggers configuration takes a list of types described with Fully Qualified Type Name, eg. Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog. See, that there's only one , in that name.

In your configuration, you specified two fully qualified type names, you haven't separated them, so they are read as a single name with 3 , in it, which is invalid for a FQTN. Simply separate those two types:

akka {
    loggers = [
        "Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog",
        "Akka.TestKit.TestEventListener, Akka.TestKit"
    ]
}

User contributions licensed under CC BY-SA 3.0