我一直在尝试创建一个使用 Akka.Remote 和 akka.net 1.3 的演员系统......但是,由于以下异常,我无法创建该系统的实例:
TypeLoadException: Cannot instantiate transport [Akka.Remote.Transport.DotNetty.DotNettyTransport]. It has no public constructor with [Akka.Actor.ActorSystem] and [Akka.Configuration.Config] parameters
问题是,我的配置是从 Akka.NET 文档中复制的,我不知道我做错了什么。这是配置:
<?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>
我会很感激一些关于我做错了什么的反馈。谢谢你。
编辑:这是堆栈跟踪:
" 在 Akka.Remote.EndpointManager.get_Listens()\r\n--- 从先前引发异常的位置结束堆栈跟踪 ---\r\n 在 Akka.Remote.EndpointManager.<>c__DisplayClass48_0.b__0() \r\n 在 System.Threading.Tasks.Task`1.InnerInvoke()\r\n 在 System.Threading.Tasks.Task.Execute()"