4es*_*est 1 .net c# system.diagnostics .net-core
I got method in console app .net 4.6:
using System.Diagnostics;
public static void CPUMonitorTest()
{
var cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
...
}
Run Code Online (Sandbox Code Playgroud)
When try to do it into class library .NET Core 2.0 I got problem:
What can I do now?
You need package System.Diagnostics.PerformanceCounter. Install it using package manager or console
Install-Package System.Diagnostics.PerformanceCounter -Version 4.5.0
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
467 次 |
| 最近记录: |