.net core 调用PerformanceCounterCategory.Exists()会在docker中抛出System.PlatformNotSupportedException

.net core 调用PerformanceCounterCategory.Exists()会在docker中抛出System.PlatformNotSupportedException,.net-core,.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.D

出于某种原因,在运行时,我会得到

 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)
但是,查看system diagnostics performancecounter文档,可以看到.NETCore 2.2的库


文档可在此处找到

您在docker容器中运行的操作系统是什么?性能计数器仅在Windows上受支持。已获取。这是有道理的。我在docker环境中运行它,它正在运行linux。我想他们应该把文件弄清楚。如果你能回答这个问题,我会接受你的正确答案。谢谢