extensions
extensions copied to clipboard
Conditionally remove instrument caching in Metrics source-gen
Right now we have caching of instruments in Metrics source-gen: https://github.com/dotnet/extensions/blob/7271d1923ef31670feefbcba1e55751dcc3e6bfa/src/Generators/Microsoft.Gen.Metrics/MetricFactoryEmitter.cs#L109
The original issue https://github.com/dotnet/runtime/issues/84713 was resolved in System.Diagnostics.DiagnosticSource of version 8, thus we can check its version during generation time and not add any caching logic. If the package version if older than 8, we will produce the same codebase as we have now.