System.Management currently is only supported for Windows desktop applications.

Fiona 125 信誉分
2025-08-14T07:24:32.3866667+00:00

I use ManagementObject which is in System.Management.dll(4.6.0) in a class library

The class libray 's TargetFramework is netstandard2.0.

Then I reference the class library in a service whick is based on BackgroundService,

when I run the service , there is an error :

System.Management currently is only supported for Windows desktop applications.

why ?what should i do ?

开发人员技术 | .NET | .NET 运行时
0 个注释 无注释
{count} 票

你的答案

提问者可以将答案标记为“已接受”,版主可以将答案标记为“已推荐”,这有助于用户了解答案是否解决了提问者的问题。