解决方法
使用低版本
- System.Management v7.0.1
<PackageReference Include="System.Management" Version="7.0.1" />
-
主工程引用 System.Management v7.0.1
-
不适用cpu
//不用cpu
//hardwareInfo.RefreshCPUList();
//error:Performance Counters are not supported on this platform.
参考
- Using Library project .NET Standard 2.1 and System.Management Nuget v7.0.0
- Trying to call any object of System.Management from WPF application .NET Core 3.1 and receive the error:
System.Management throw System.PlatformNotSupportedException: 'System.Management currently is only supported for Windows desktop applications.'