Reputation: 3168
I got method in console app .net 4.6:
using System.Diagnostics;
public static void CPUMonitorTest()
{
var cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
...
}
When try to do it into class library .NET Core 2.0 I got problem:
What can I do now?
Upvotes: 1
Views: 524
Reputation: 5351
You need package System.Diagnostics.PerformanceCounter. Install it using package manager or console
Install-Package System.Diagnostics.PerformanceCounter -Version 4.5.0
Upvotes: 5