I had this code to correct this errors in the version 3.3.3:
protected void Application_Start()
{
var builder = new ContainerBuilder();
builder
.Register(c => new CachingBotDataStore(c.Resolve<ConnectorStore>(), CachingBotDataStoreConsistencyPolicy.LastWriteWins))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
builder.Update(Conversation.Container);
GlobalConfiguration.Configure(WebApiConfig.Register);
}
It was in the static builder of the messagesController
But if doesn't work anymore, it throws an exception
What exception does it throw?
I have the same issue. Was using 3.5.1 and everything worked. Updated to 3.5.3 in order to use the newest AuthBot and the bot stopped answering. In my case it is a 500 Server Error.
"Exception thrown: 'System.TypeInitializationException' in BotName.dll"
If I revert back to 5.3.1 it works again. Any clues?
Thanks!
@willportnoy it throws: Autofac.Core.Registration.ComponentNotRegisteredException, The requested service 'Microsoft.Bot.Builder.Dialogs.Internals.ConnectorStore' 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.
The registration of ConnectorStore has changed:
You might change the c.Resolve<ConnectorStore>() in the above code to c.ResolveKeyed<IBotDataStore<BotData>>(typeof(ConnectorStore))
@willportnoy That worked, thanks!
@willportnoy your last comment is important as the documentation is not up-to-date on page https://docs.microsoft.com/en-us/bot-framework/troubleshoot-general-problems
@willportnoy Hi, I changed the code as you suggested. There is no exception thrown, but my context object does not work. I get the data from the context is null. Any advice?
@298029lkk This is a closed issue. Please create a new issue, or ask a question on Stack Overflow.
Most helpful comment
The registration of ConnectorStore has changed:
https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Library/Microsoft.Bot.Builder.Autofac/Dialogs/DialogModule.cs#L140
You might change the
c.Resolve<ConnectorStore>()in the above code toc.ResolveKeyed<IBotDataStore<BotData>>(typeof(ConnectorStore))