Skip to content

AspNetCore AddApplicationInsightsSettings() and MissingMethodException #1702

@TimothyMothra

Description

@TimothyMothra

This was brought to my attention by @brettsam


In AppInsights.AspNetCore 2.12.0 I changed the method signature of AddApplicationInsightsSettings by adding the optional parameter connectionString.

public static IConfigurationBuilder AddApplicationInsightsSettings(
this IConfigurationBuilder configurationSourceRoot,
bool? developerMode = null,
string endpointAddress = null,
string instrumentationKey = null,
string connectionString = null)

This can cause a MissingMethodException for users upgrading from an older version of our SDK.
(Explanation of MissingMethodException and default parameters: https://stackoverflow.com/a/9884700/1466768)

Next Steps

I think this will be a straightforward fix, I should be able to add a method overload matching the signature of the original method.
I'm setting up a repro right now so I can verify a fix.
The plan is to release a patch for versions 2.12, 2.13, and 2.14

Next Next Steps

This highlights the need to add a PublicApiAnalyzer to our other projects.
We currently only have this analyzer on 2/17 of our projects.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions