You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List of NuGet packages and version that you are using: 2.22.0
Runtime version: net8.0
Hosting environment: Any
Describe the bug
When there are KeyedSingleton Registrations to IServiceCollection, the method AddApplicationInsightsTelemetry doesn't work if it is called after calling services.AddKeyedSingleton method.
More Info:
This is happening because here, the code is checking only for ImplementationType and ImplementationInstance.
Instead, I think it should also check for KeyedImplementationType & KeyedImplementationInstance
To Reproduce
Simply run this web application to reproduce the issue. Please note the below two lines in the program.cs
Always use the AddApplicationInsightsTelemetry method before registering any keyed instances
We will close this issue if:
The repro project you share with us is complex. We can't investigate custom projects, so don't point us to such, please.
If we will not be able to repro the behavior you're reporting
For Immediate Support
For immediate support relating to the Application Insights .NET SDK we encourage you to file an Azure Support Request with Microsoft Azure instead of filing a GitHub Issue in this repository.
You can do so by going online to the Azure portal and submitting a support request. Access to subscription management and billing support is included with your Microsoft Azure subscription, and technical support is provided through one of the Azure Support Plans. For step-by-step guidance for the Azure portal, see How to create an Azure support request. Alternatively, you can create and manage your support tickets programmatically using the Azure Support ticket REST API
The text was updated successfully, but these errors were encountered:
Describe the bug
When there are KeyedSingleton Registrations to IServiceCollection, the method
AddApplicationInsightsTelemetry
doesn't work if it is called after calling services.AddKeyedSingleton method.More Info:
This is happening because here, the code is checking only for ImplementationType and ImplementationInstance.
Instead, I think it should also check for KeyedImplementationType & KeyedImplementationInstance
To Reproduce
Simply run this web application to reproduce the issue. Please note the below two lines in the program.cs
https://github.com/mavsankar/AppInsightsSdk-KeyedInstance-Repro
Workaround
Always use the
AddApplicationInsightsTelemetry
method before registering any keyed instancesWe will close this issue if:
For Immediate Support
For immediate support relating to the Application Insights .NET SDK we encourage you to file an Azure Support Request with Microsoft Azure instead of filing a GitHub Issue in this repository.
You can do so by going online to the Azure portal and submitting a support request. Access to subscription management and billing support is included with your Microsoft Azure subscription, and technical support is provided through one of the Azure Support Plans. For step-by-step guidance for the Azure portal, see How to create an Azure support request. Alternatively, you can create and manage your support tickets programmatically using the Azure Support ticket REST API
The text was updated successfully, but these errors were encountered: