I've been trying to create an actor system that uses Akka.Remote with akka.net 1.3... However, I can't create an instance of the system due to the following exception:
TypeLoadException: Cannot instantiate transport [Akka.Remote.Transport.DotNetty.DotNettyTransport]. It has no public constructor with [Akka.Actor.ActorSystem] and [Akka.Configuration.Config] parameters
The thing is, my config is copied from the Akka.NET documentation, and I don't know what I have failed to do.. here is the config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<akka>
<hocon>
<![CDATA[
akka {
stdout-loglevel = INFO
loglevel = INFO
# this config section will be referenced as akka.actor
actor {
provider = remote
debug {
receive = on
autoreceive = on
lifecycle = on
event-stream = on
unhandled = on
}
}
# here we're configuring the Akka.Remote module
remote {
dot-netty.tcp {
transport-class = "Akka.Remote.Transport.DotNetty.DotNettyTransport,Akka.Remote"
#applied-adapters = []
transport-protocol = tcp
port = 9090
hostname = "127.0.0.1"
}
}
}
]]>
</hocon>
</akka>
</configuration>
I would appreciate some feedback on what I am doing wrong. Thank you.
EDIT: here is the stacktrace:
" at Akka.Remote.EndpointManager.get_Listens()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Akka.Remote.EndpointManager.<>c__DisplayClass48_0.b__0()\r\n at System.Threading.Tasks.Task`1.InnerInvoke()\r\n at System.Threading.Tasks.Task.Execute()"
Looks like you have incorrect transport configuration . instead of specifying transport you should use the default transport by removing
the base configuration uses Akka.Remote.Transport.DotNetty.TcpTransport,Akka.Remote you don't need to explicitly define it in your configuration , unless there is a reason for that.