Autofac.Core.DependencyResolutionException in AlarmBot
I noticed that since the ResumptionCooki got 2 constructors the Sample AlarmBot did not work anymore.
Exception thrown: 'Autofac.Core.DependencyResolutionException' in Autofac.dll
Additional information: Cannot choose between multiple constructors with equal length 1 on type 'Microsoft.Bot.Builder.Dialogs.ResumptionCookie'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component is registered.
The error occurs in in AlarmModule.cs at this line:
builder.Register(c => new RenderingAlarmService(new AlarmService(c.Resolve<IAlarmScheduler>(), c.Resolve<ResumptionCookie>()), c.Resolve<Func<IAlarmRenderer>>(), c.Resolve<IBotToUser>(), c.Resolve<IClock>())).Keyed<IAlarmService>(FiberModule.Key_DoNotSerialize).AsImplementedInterfaces().InstancePerMatchingLifetimeScope(DialogModule.LifetimeScopeTag);
Like the error message says, use UsingConstructor(), i inserted this line above the error line:
builder.RegisterType<ResumptionCookie>().UsingConstructor(typeof(IMessageActivity));
But is this the right way?
I think Sample code should alway work...
We have this fixed in the develop branch - @msft-shahin have we done a release?
ok that's great.
@willportnoy thank you for your fast response
@kevinport this should be fixed in the next release of bot builder. We are planing on having a bug fix release in the coming days.
@msft-shahins thanks.
close?
@kevinport this should be fixed with the 3.3 release. do you still see this?
@msft-shahins yes it is fixed, i only ask to close :)