Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

CimSession.Create(null) does not work on Windows 7 (x86) #43

Open
natnan opened this issue Oct 31, 2019 · 3 comments
Open

CimSession.Create(null) does not work on Windows 7 (x86) #43

natnan opened this issue Oct 31, 2019 · 3 comments

Comments

@natnan
Copy link

natnan commented Oct 31, 2019

Perhaps this is expected. It's hard to find any information about that.

My goal is to get some WMI information out of Windows. System.Management is considered legacy apparently and does not work well with .NET Core when you don't have unspecified version of .NET Framework installed. And the recommended way is to utilize MMI.

It works fine on Windows 10 now but Windows 7 (x86 though not necessarily relevant) fails with not much to go on.

CimSession.Create(null);

Microsoft.Management.Infrastructure.CimException: FAILED
   at Microsoft.Management.Infrastructure.CimException.ThrowIfMiResultFailure(MiResult result, String errorMessage, InstanceHandle errorData)
   at Microsoft.Management.Infrastructure.CimException.ThrowIfMiResultFailure(MiResult result, InstanceHandle errorData)
   at Microsoft.Management.Infrastructure.CimSession.Create(String computerName, CimSessionOptions sessionOptions)
   at Microsoft.Management.Infrastructure.CimSession.Create(String computerName)

Tried both 1.0.0 and 2.0.0-preview2

@shazha
Copy link

shazha commented Dec 24, 2019

You need Windows Management Framework 3.0 be installed on Windows 7 SP1. please install .Net Framework 4.0 first as it's required by WMF 3.0.

@natnan
Copy link
Author

natnan commented Dec 24, 2019

Right. That is not very ideal as the use case is just simple information gathering from the local system (productid, Windows version etc.) that should ideally be available without installing extra management frameworks. It's especially difficult when it's a desktop application requiring the information where adding such requirements is an overkill.

I understand the requirement from MMI perspective though, and it that's the way it is, feel free to close the issue.

Thanks.

@valeriob
Copy link

valeriob commented Sep 8, 2020

Hi,
i'm having the same problem, even after i've installed the Windows Management Framework 3.0 on a windows 7 SP1 x64.
The problem is that it's a windows 7 embedded , peraps there is some more requirement needed ?
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants