使用香草 NServiceBus 6.0.0-beta0004
运行var endpointConfiguration = new EndpointConfiguration("endpoint");
endpointInstance = await Endpoint.Start(endpointConfiguration).ConfigureAwait(false);
这会引发异常:
Bus.ProgramService An unhandled error has occurred.
Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'NServiceBus.RecoverabilityExecutorFactory' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
at NServiceBus.AutofacObjectBuilder.Build(Type typeToBuild) in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\ObjectBuilder\Autofac\AutofacObjectBuilder.cs:line 39
at NServiceBus.CommonObjectBuilder.Build[T]() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\ObjectBuilder\Common\CommonObjectBuilder.cs:line 28
at NServiceBus.StartableEndpoint.CreateReceivers() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\StartableEndpoint.cs:line 93
at NServiceBus.StartableEndpoint.<Start>d__1.MoveNext() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\StartableEndpoint.cs:line 45
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at NServiceBus.Endpoint.<Start>d__1.MoveNext() in D:\Code\GitHub\agupta-au\NServiceBus\src\NServiceBus.Core\Endpoint.cs:line 28
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
我错过了什么?我的理解是,可恢复性的东西与第一级重试+二级重试有关,但我还没有设置它。此外,这些人之间似乎已经讨论过这个问题:https://github.com/Particular/NServiceBus/pull/3828
非常感谢任何帮助:)
答案 0 :(得分:1)
正如丹尼尔在评论中已经提到的,这段代码不应该是可用测试包的一部分。强烈建议坚持使用NuGet上的可用测试版软件包,因为在使用任何持久性/传输软件包时,它很可能会遇到问题。 release-6.0.0分支仍在积极开发中。
(但当然不应该发生异常;))