question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

does not work on Windows 7 enterprise sp1

See original GitHub issue

The Win7 OS only install .net 6 runtime, and my code reference DeviceId.Windows.Mmi. When I try to get device id, it throw error message as below, and I found the relate issue of mmi https://github.com/PowerShell/MMI/issues/43

Time:2022-06-01 11:50:32.6242 Software version: 1.0.0.0 Operating system information: Message: 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 DeviceId.Windows.Mmi.Components.MmiSystemDriveSerialNumberDeviceIdComponent.GetValue() at DeviceId.Formatters.HashDeviceIdFormatter.<>c.<GetDeviceId>b__3_1(KeyValuePair2 x) at System.Linq.Enumerable.SelectIPartitionIterator2.PreallocatingToArray(Int32 count) at System.Linq.Enumerable.SelectIPartitionIterator2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at DeviceId.Formatters.HashDeviceIdFormatter.GetDeviceId(IDictionary2 components) at DeviceId.DeviceIdBuilder.ToString() at Microsoft.Practices.EnterpriseLibrary.Security.SerialKeyManager.GetDeviceId(String productName, String productVersion) at Omec.ResistanceCounter.ViewModels.Common.SerialNumberHelper.GetCurrentMachineSerialNumber(String productName, String productVersion) in C:\Projects\ResistanceCounter\Omec.ResistanceCounter\Omec.ResistanceCounter.ViewModels\Common\SerialNumberHelper.cs:line 28 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 DeviceId.Windows.Mmi.Components.MmiSystemDriveSerialNumberDeviceIdComponent.GetValue() at DeviceId.Formatters.HashDeviceIdFormatter.<>c.<GetDeviceId>b__3_1(KeyValuePair2 x) at System.Linq.Enumerable.SelectIPartitionIterator2.PreallocatingToArray(Int32 count) at System.Linq.Enumerable.SelectIPartitionIterator2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at DeviceId.Formatters.HashDeviceIdFormatter.GetDeviceId(IDictionary2 components) at DeviceId.DeviceIdBuilder.ToString() at Microsoft.Practices.EnterpriseLibrary.Security.SerialKeyManager.GetDeviceId(String productName, String productVersion) at Omec.ResistanceCounter.ViewModels.Common.SerialNumberHelper.GetCurrentMachineSerialNumber(String productName, String productVersion) in C:\Projects\ResistanceCounter\Omec.ResistanceCounter\Omec.ResistanceCounter.ViewModels\Common\SerialNumberHelper.cs:line 28

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
songjiefacommented, Aug 10, 2022

DeviceId.Windows.Mmi & DeviceId.Windows & DeviceId =>6.2.0.0 .net runtime => 6.0.1

0reactions
MatthewKingcommented, Sep 3, 2022

Ah yep, if you’re installing on a system that doesn’t have .NET Framework at all then you’ll need MMI rather than WMI. That’s as far as I can help you, though. If MMI isn’t working on your (out of support) OS then you’ll need to raise an issue there. Or use DeviceId features that don’t rely on WMI/MMI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot issues installing Windows 7 Service Pack 1
To do this, type sfc/scannow, press ENTER, and then wait for the process to finish. Install Windows 7 SP1.
Read more >
You do not have the option of downloading Windows 7 ...
Method 1: Confirm that Windows 7 SP1 is not already installed and that you are not running a prerelease version of Windows 7...
Read more >
Windows 7 Windows Update Not Working [FIX] - YouTube
There are several reasons why you would want to purge the Windows Update cache. Doing so will allow you to instantly reclaim valuable ......
Read more >
Windows 7 Enterprise
Windows 7 is a Microsoft operating system, designed to be run on Windows-compatible computers. An upgrade to this operating system from previous versions...
Read more >
Windows 7 Updates Not Downloading? Here's How to Fix It!
Fix 1: Prepare the Prerequisites for Windows 7 Updates; Fix 2: Manually Download and Install the Updates; Fix 3: Use the Microsoft Update ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found