I have a super simple echo bot (fresh out of the template) with an extra action to send a custom telemetry event to application insights with the input from the user, however it doesn't work. When trying the bot in the emulator I get a 500 error, and when running the project without the composer I get the following message:
`fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HM35SOKSNO2T", Request id "0HM35SOKSNO2T:00000001": An unhandled exception was thrown by the application.
System.Exception: echobot-1.dialog error: Type Microsoft.TelemetryTrackEvent not registered in factory.
at Microsoft.Bot.Builder.Dialogs.Declarative.Resources.ResourceExplorer.LoadTypeAsyncT
at Microsoft.Bot.Builder.Dialogs.Declarative.Resources.ResourceExplorer.LoadTypeT
at Microsoft.BotFramework.Composer.Core.ComposerBot.LoadRootDialogAsync() in /Users/rafael.quesada/Projects/bot_builder_template_tests/EchoBot-1/runtime/core/ComposerBot.cs:line 69
at Microsoft.BotFramework.Composer.Core.ComposerBot..ctor(ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, BotFrameworkClient skillClient, SkillConversationIdFactoryBase conversationIdFactory, IBotTelemetryClient telemetryClient, String rootDialog, String defaultLocale, Boolean removeRecipientMention) in /Users/rafael.quesada/Projects/bot_builder_template_tests/EchoBot-1/runtime/core/ComposerBot.cs:line 43
at Microsoft.BotFramework.Composer.WebAppTemplates.Startup.<>c__DisplayClass12_0.b__4(IServiceProvider s) in /Users/rafael.quesada/Projects/bot_builder_template_tests/EchoBot-1/runtime/azurewebapp/Startup.cs:line 187
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)
at lambda_method(Closure , IServiceProvider , Object[] )
at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.b__0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsTContext`
I haven't done any customizations to the runtime and the docs don't point to anything I might be doing wrong, am I missing something here?
I should mention that I do receive other traces in app insights, so it seems to be properly configured.
1.1.1
Steps to reproduce the behavior:
When using a custom telemetry event, it should be sent to application insights and appear when querying the logs.


@garypretty can you troubleshoot this since you drove this into Composer?
@garypretty do you have any update for this issue? Thanks.
Sorry for the delay @RafaelQuesada.
Can you confirm that when you say this was fresh out of the template, is this a bot that you created just recently? Also, have you ejected the runtime or are you running from the default runtime Composer uses? My first thought when looking at the error message was that your runtime had been ejected and was out of date.
I am unable to confirm this right now due to a local issue, but I did work through a telemetry scenario in Composer a couple weeks ago and believe I did use this new action without any issue.
@cwhitten I don't have capacity to drive this at the moment, can you assign an engineering resource to look into this please? They can reach out to me if they need any assistance, but should be as straightforward as adding the action to the canvas and running the bot to confirm if they can repro or not. Thanks.
Sorry! I forgot to mention this here on Friday; but I am able to reproduce this as well. I tried debugging in VS with a copy of the C# runtime, but I couldn't figure it out. I don't have much more to add than that.
Hey @garypretty
Correct, a new simple echo bot created just to test this. I did eject the runtime, but I just tried it again without ejecting it and got the same error in emulator.



taking into R11 and assigning @luhan2017 - this will be addressed in an upcoming release.
This is because the schema and code mismatch. In schema, the action is called "TelemetryTrackEvent", but in code it is declared as "TelemetryTrackEventAction", I will submit a PR in the sdk side to fix this issue.
You are mitigate this issue by update your dialog file. @RafaelQuesada
Click show code, and replace "$kind": "Microsoft.TelemetryTrackEvent" with "$kind": "Microsoft.TelemetryTrackEventAction", then Restart your bot, it will work.
@cwhitten @garypretty锛孖 will submit a PR to fix this in the sdk side.
Thanks @luhan2017, works like a charm!
Closing in lieu of https://github.com/microsoft/botbuilder-dotnet/pull/4820