난 그냥 업그레이드 NServiceBus를 업그레이드 한 후 나는 "4-5"문서에 제안 된 단계를하고 컴파일 할 수입니다. 이제 다음과 같은 오류 메시지가 나타납니다.AutoFac 예외 5.0</p> <p>4.6에서 NServiceBus
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Nop.Web.Controllers.ShoppingCartController' can be invoked with the available services and parameters: Cannot resolve parameter 'NServiceBus.IBus bus' of constructor 'Void .ctor(NServiceBus.IBus, ...
수행해야 할 작업은 무엇입니까?
(업데이트 : 내 구성)
public static class ServiceBus
{
public static void Init(ILifetimeScope scope)
{
var configuration = new BusConfiguration();
configuration.EndpointName(ConfigurationManager.AppSettings["ServiceBusEndpointName"]);
configuration.UseTransport<MsmqTransport>();
configuration.UseSerialization<JsonSerializer>();
configuration.UsePersistence<RavenDBPersistence>();
configuration.DisableFeature<Sagas>();
configuration.Transactions().Enable();
configuration.AssembliesToScan(AllAssemblies
.Matching("Nop.Services.dll")
.And("TengoMessages.dll")
.And("Partner.Pricing.Messages.dll")
.And("Partner.Pricing.Infrastructure.dll"));
configuration.UseContainer<AutofacBuilder>();
configuration.PurgeOnStartup(false);
var bus = Bus.Create(configuration);
bus.Start();
var newBuilder = new ContainerBuilder();
newBuilder.RegisterInstance(bus);
newBuilder.Update(Singleton<IContainer>.Instance);
}
이것이 어떻게 효과가 있었는지 확실하지 않습니다. NSB 4에서는, yoru 자신의 컨테이너를 사용할 때 그것을 컨 피규 레이터에 매개 변수로 전달해야합니다. NServiceBus가 귀하의 컨테이너에 대해 알고 있지 않다면 어떻게 귀하의 의존성을 해결할 수 있을지 생각해보십시오. –
몇 주간의 버그 수정 후 우리는 프로젝트를 롤백하고 버전 4.6으로 유지하기로 결정했습니다. –
이 문제는 쉽게 해결할 수 있습니다. http://docs.particular.net/nservicebus/containers –