An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
Nullreference exeption in AddApplicationInsightsTelemetryWorkerService
Martin Vollmer
1
Reputation point
In a .dll I have a method to send an Azure Application Event. The method contains the following lines:
TelemetryConfiguration configuration = new TelemetryConfiguration(orchestrationKeyToUse);
IServiceCollection services = new ServiceCollection();
services.AddSingleton<ITelemetryInitializer, KnaufCustomTelemetryInitializer>();
services.AddApplicationInsightsTelemetryWorkerService(orchestrationKeyToUse);
services.AddApplicationInsightsTelemetryProcessor<KnaufCustomTelemetryProcessor>();
When I call the method from an exe, there is no problem.
When I call the method in an interface method of an addin, it throws an Nullreference-Exception in AddApplicationInsightsTelemetryWorkerService.
I tried to start a thread and call the method in the thread, but it throws the Nullreference-Exception there, too.
What could be the reason?
Azure Monitor
Azure Monitor
Sign in to answer