Skip to content

Microsoft.Management.Infrastructure vs System.Management #24803

Closed

Description

@czb182

This is more of a question than an issue, but wasn't sure where else to ask.

I just got starting working with WMI via C# using FullCLR. I am consuming the Microsoft.Management.Infrastructure assembly since it was describing as being the modern version of System.Management here https://msdn.microsoft.com/en-us/library/mt703458(v=vs.85).aspx

I was trying to look into a CoreCLR version of Microsoft.Management.Infrastructure and heard about the Windows Compatibility Pack, so found myself here. I was surprised to see System.Management instead of Microsoft.Management.Infrastructure in repo, since I thought the former was basically deprecated from link I posted above.

My question is basically should I revert to using System.Management for compatibility with CoreCLR in future, or is there a CoreCLR version of Microsoft.Management.Infrastructure coming? I am new to WMI and would appreciate any clarification.

Activity

  1. iSazonov commented on Feb 10, 2018

    @iSazonov
    Contributor

    Good question. I wonder too that WMI instead of MMI was ported to .Net Core.
    PowerShell Core depends on MMI and currently uses limited version https://www.nuget.org/packages/Microsoft.Management.Infrastructure/ . Tracking Issue PowerShell/PowerShell#4562.

    /cc @SteveL-MSFT

  2. danmoseley commented on Feb 10, 2018

    @danmoseley
    Contributor

    We ported System.Management purely to make it easier to port legacy code to.NET Core. We don't recommend new code use it.
    @ViktorHofer could you please check whether MMI has complete functionality on.NET Core?

  3. ViktorHofer commented on Feb 10, 2018

    @ViktorHofer
    Member

    will do.

  4. ViktorHofer commented on Feb 11, 2018

    @ViktorHofer
    Member

    The API is compatible with .NET Standard 2.0, only SecurityContext was problematic. Had to add a nuget package and cross-compile as SecurityContext throws on Core because it's stubbed out.

  5. iSazonov commented on Feb 11, 2018

    @iSazonov
    Contributor

    We don't recommend new code use it.

    @danmosemsft It would be good to know what MSFT recommends instead. (Is there a documentation, a blog article or an Issue?)

  6. SteveL-MSFT commented on Feb 12, 2018

    @SteveL-MSFT
    Contributor

    On Windows, we recommend using Microsoft.Management.Infrastructure namespace (aka WMIv2). System.Managmeent (aka WMIv1) is deprecated. On non-Windows, we currently don't have plans to port either namespace.

  7. czb182 commented on Feb 21, 2018

    @czb182
    Author

    https://blogs.msdn.microsoft.com/powershell/2018/01/24/powershell-core-6-1-roadmap/

    powershell core 6.1 will bring WMI, leveraging .net windows compatibility pack. So this means WMI with powershell core WMI will be built over System.Management rather than MMI? If MMI could be made NetStandard compatible, then maybe it would be useful for powershell team and included in compatibility pack? Maybe then we could get netstandard compatible version of library on nuget to replace
    https://www.nuget.org/packages/Microsoft.Management.Infrastructure/

  8. SteveL-MSFT commented on Feb 22, 2018

    @SteveL-MSFT
    Contributor

    @czb182 The WindowsPowerShellCompatibilityPack module will be optional. On Windows, the CIM cmdlets are part of the PSCore6 distribution. Not sure if we'll get to porting the WMI cmdlets in 6.1 timeframe as it's turned out to be a much bigger work item than originally anticipated. As for MMI being NetStd compatible, I don't think this is possible as MMI is written in managed C++ which is no longer supported by dotnet.

  9. transferred this issue fromdotnet/corefxon Jan 31, 2020
  10. added this to the 2.1.0 milestone on Jan 31, 2020
  11. ghost locked as resolved and limited conversation to collaborators on Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Managementquestion

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions