ApplicationInsights-dotnet
ApplicationInsights-dotnet copied to clipboard
Build Error: StandardPerformanceCounter IDisposable
Build system is throwing this error intermittently. Need to confirm this change is made in the code.
##[error]WEB\Src\PerformanceCollector\PerformanceCollector\Implementation\StandardPerformanceCollector\StandardPerformanceCounter.cs(12,36): Error CA2213: 'StandardPerformanceCounter' contains field 'performanceCounter' that is of IDisposable type 'PerformanceCounter', but it is never disposed. Change the Dispose method on 'StandardPerformanceCounter' to call Close or Dispose on this field.
https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/StandardPerformanceCollector/StandardPerformanceCollector.cs#L313
This is happening sometimes for some files. And every file that I saw was disposing correctly.
I saw this error on our DEVELOP branch.
I don't see any fields of type PerformanceCounter in this class.
But the field in the exception performanceCounter is not being disposed. However, it's a List so it shouldn't need to be disposed.
After I updated the packages, I left this TODOs:
- BASE/src/Microsoft.ApplicationInsights/Metrics/Implementation/ConcurrentDatastructures/MultidimensionalCube2.cs, Line 261
- WEB/Src/PerformanceCollector/PerformanceCollector/PerformanceCollectorModule.cs, Line 275
This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.