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

Fiona 105 信誉分
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} 票

你的答案

问题作者可以将答案标记为“接受的答案”,这有助于用户了解已解决作者问题的答案。