简体   繁体   English

如何在 VSCode 中添加对 System.Management 的引用?

[英]How to add the reference for System.Management in VSCode?

How to add the reference for System.Management in VSCode?如何在 VSCode 中添加对System.Management的引用? It always shows the error:它总是显示错误:

"The type or namespace name 'Management' does not exist in the namespace 'System'" “命名空间‘系统’中不存在类型或命名空间名称‘管理’”

I've right clicked on System.Management and there is no option of any reference management.我右键单击System.Management并且没有任何参考管理选项。 Really don't know how to deal with this.这个真的不知道怎么处理。

I guess you are developing Xamarin application.我猜你正在开发 Xamarin 应用程序。 System.Management is Windows only namespace/package, you'll need platform specific way of getting the MAC address. System.Management是 Windows 唯一的命名空间/包,您需要特定于平台的方式来获取 MAC 地址。 Without more details it's hard to tell what exactly you are trying to accomplish but you could take a look at this question: https://stackoverflow.com/a/43885747/1286216没有更多细节,很难说出你到底想要完成什么,但你可以看看这个问题: https://stackoverflow.com/a/43885747/1286216

Also, be aware that newer Android devices randomize MAC address.此外,请注意较新的 Android 设备会随机分配 MAC 地址。

Firstly select the Project in the top left corner.首先 select 左上角的Project

在此处输入图像描述

Then right click the project in solution explorer then click Reference and Add .然后右键单击解决方案资源管理器中的项目,然后单击ReferenceAdd

在此处输入图像描述

Here within the Reference manager dialogue box you can choose the System.(Whatever you want) .在参考管理器对话框中,您可以选择System.(Whatever you want)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM