Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddApplicationInsightsTelemetry() not working when AddOpenApi() is already called #2915

Open
KimihikoSaito opened this issue Nov 13, 2024 · 0 comments
Labels

Comments

@KimihikoSaito
Copy link

  • Framework Version : net9.0
  • Microsoft.ApplicationInsights.AspNetCore 2.22.0
  • Microsoft.AspNetCore.OpenApi 9.0

Describe the bug

Work ApplicationInsightsTelemetry:

services.AddApplicationInsightsTelemetry();
services.AddOpenApi();

DO NOT work ApplicationInsightsTelemetry:

services.AddOpenApi();
services.AddApplicationInsightsTelemetry();

Exception has thrown at inside ApplicationInsightsExtensions.AddCommonTelemetryModules(services);.

services.AddSingletonIfNotExists<ITelemetryModule, DiagnosticsTelemetryModule>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant