调用PerformanceCounterCategory.Exists()会在Docker中引发System.PlatformNotSupportedException

时间:2019-04-26 05:45:02

标签: .net-core

由于某种原因,在运行时,我会获得

的异常
 System.AggregateException: One or more errors occurred. (Performance Counters are not supported on this platform.) ---> System.PlatformNotSupportedException: Performance Counters are not supported on this platform.
   at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)

但是,查看系统诊断性能计数器文档,该库适用于.NETCore 2.2

可以在这里https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.performancecountercategory.exists?view=netcore-2.2

找到该文档

0 个答案:

没有答案