Short answer is that method is missing because someone in the development team forgot to use an Obsolete attribute. This method in the TelemetryClient class in the Microsoft.ApplicationInsights NuGet package is used very often. After the latest update of the package it just disappeared. Surprisingly, the method isn’t listed the IntelliSence but the older code where this method is used can be successfully compiled without any error or warning.
The case
The chronological order of events which forced me to write this article was following:
May 23, Microsoft.ApplicationInisghts, 2.6.4
The TelemetryClient.TrackMetric method does not contain any summary or attribute which would affect IDE.
August 7, Microsoft.ApplicationInisghts, 2.7.1
The TelemetryClient.TrackMetric method gets the summary Documentation Comment. There is nothing bad, but the information it contains does not have the right semantic. The summary tag is used to describe a type or a type member. It isn’t intended to mark the stage of its lifecycle.
/// <summary>
/// This method is deprecated...
/// </summary>
August 11, Microsoft.ApplicationInisghts, 2.7.2
Four days after, the TelemetryClient.TrackMetric method is hidden from the IntelliSence. There is nothing bad, but this step makes impossible to see the content of the summary tag above.
[EditorBrowsable(EditorBrowsableState.Never)]
My recommendation
- Tell users of your library about method deprecation by attributing it with the Obsolete attribute and let them several months for adapting their code to your changes.
- Use the summary tag for describing functionality, not for announcing lifecycle progress.
- Use TFVC’s Code Review. If you must use Git adopt a code review process.
- In general, hiding a method from the IntelliSence isn’t a good idea because the overhead for backward compatibility is hidden. It makes sense in rare cases only, for example in case of making a new framework compatible with the legacy code written for the framework predecessor.