无法在Dot Net Core中使用System.Management.dll [英] Not able to use System.Management.dll in Dot Net Core

查看:859
本文介绍了无法在Dot Net Core中使用System.Management.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果 System.Management.dll Dot Net Core 不兼容,我应该如何收集硬件信息。

How should I gather Hardware Info if System.Management.dll is not compatible with Dot Net Core.

如何获取机器信息,例如处理器ID,磁盘卷号等。

How do I get the Machine info like Processor Id, Disk Volume number etc.

推荐答案

。 NET Core 3现在支持System.Management。截至目前,.NET Core 3处于预览模式,其中预览4为最新版本。

.NET Core 3 now supports System.Management. As of this time, .NET Core 3 is in preview mode with preview 4 as the most current.

您将必须选择 Manage NuGet软件包。 。菜单项,以安装最新版本的System.Management。确保选中包括预览复选框,以便您安装最新版本。

You will have to select the Manage NuGet packages... menu item under the Project menu in Visual Studio to install the latest version of System.Management. Make sure that the include previews checkbox is selected so that you will install the latest version.

先前版本的System.Management引发错误:

The previous version of System.Management throws an error:


无法使用[Out]属性将字符串值编组...

"Cannot marshal a string by-value with the [Out] attribute..."

有关更多信息,请参见此链接有关错误的信息。

See this link for more info about the error.

这篇关于无法在Dot Net Core中使用System.Management.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆