2

I need to get the hardware ID (CPU ID) of the host using .NET Core 2. How can this be done?

The System.Management class from .NET has not been ported to .NET Core. Is there a cross-platform alternative to this (macOS, Linux, and Windows)?

1
  • 1
    Thank you guys. I updated the question to make it more clear. By Hardware ID, I mean any ID from Hardware except Hard Drive. I can work with CPU ID, Motherboard Serial number, etc... Commented Aug 17, 2018 at 9:07

1 Answer 1

3

Classes from System.Management namespace are available to .NET Core applications via Windows Compatibility Pack developed by Microsoft. You can reference either whole Microsoft.Windows.Compatibility metapackage, or (if you don't need other classes) just standalone System.Management package.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you @Nuf, I a aware of that. But my application is built to run in Mac and Linux. The Compatibility Pack is not going to work for me.
There is a plan to support System.Management on Linux, but probably not anytime soon :-(
.net core 3.1 is almost released. still there is nothing regarding this yet supported in .net core while we have libraries in java like oshi which help in it
NET Core is cross-platform, but COM/WMI are Windows-specific. Try Nuget nuget.org/packages/System.Management

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.