4est
4est

Reputation: 3168

Replace System.Diagnostics into .Net Core 2.0 (C#)

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

Answers (1)

cdev
cdev

Reputation: 5351

You need package System.Diagnostics.PerformanceCounter. Install it using package manager or console

Install-Package System.Diagnostics.PerformanceCounter -Version 4.5.0

enter image description here

Upvotes: 5

Related Questions