Skip to content

Microsoft.Management.Infrastructure NuGet package missing dependencies #4562

@jaredcatkinson

Description

@jaredcatkinson

I'm writing a ASP.NET Core web app that requires accessing CIM information/methods. Microsoft.Management.Infrastructure v4.0.0, available via NuGet, is not .NET Core compatible, so naturally I was curious how CIM works in PowerShell. I found that you are using a powershell-core https://powershell.myget.org/F/powershell-core/api/v3/index.json respository to host Microsoft.Management.Infrastructure v1.0.0-alpha06, so I added that to my project and everything seemed fine until I try to use any code from MMI.

I found a related issue #1204, but that issue was addressed for situations where MMI is used within the context of PowerShell. It looks like the solution was not applied directly to the MMI assembly itself.

I realize that the intention for the PowerShell Core version of MMI is to be used within the context of PowerShell, but it'd be much appreciated if the library was compatible with other use cases like ASP.NET Web Applications.

Steps to reproduce

I've posted a sample project so you can see how I am attempting to use the library.

Expected behavior

calc.exe runs on the remote host (localhost in this case). This is the result on Windows, but not Linux.

Actual behavior

The application crashes with the following error:

Unable to load DLL 'libmi.so': The specified module could not be found.

I found an issue (#2120) that talks about libmi.so being part of OMI, so I installed OMI and borrowed it. This fixed the first issue, but another issue came up with the following error:

Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Microsoft.Management.Infrastructure.Strings.resources" was correctly embedded or linked into assembly "Microsoft.Management.Infrastructure" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Environment data

The goal is to Dockerize this app, so the test system I am using is Docker's microsoft/aspnetcore Image (Debian Jessie).

uname -a
Linux ace-app 4.9.36-moby #1 SMP Wed Jul 12 15:29:07 UTC 2017 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalityResolution-Won't FixThe issue won't be fixed, possibly due to compatibility reason.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions