-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does not work on Windows 7 enterprise sp1 #56
Comments
I have the same problem. System.IO.FileNotFoundException: Could not load file or assembly 'DeviceId, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f755c371b5c59c52'. |
@songjiefa , @wagenheimer - can you specify the versions of DeviceId you use? Including versions of DeviceId.Windows.Mmi and .NET you use. |
DeviceId.Windows.Mmi & DeviceId.Windows & DeviceId =>6.2.0.0 |
Can you use DeviceId.Windows.Wmi instead? |
I use DeviceId.Windows.Wmi build WPF software with .net 6 runtime, it need package .net 6 runtime into my installer, and will throw above error in some windows 7 sp1 OS, which haven't install .net framework runtime, so I also need package .net framework 4.8 into my installer(and have to turn on .net framework 3.5) . |
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. |
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 PowerShell/MMI#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.b__3_1(KeyValuePair
2 x) at System.Linq.Enumerable.SelectIPartitionIterator
2.PreallocatingToArray(Int32 count)at System.Linq.Enumerable.SelectIPartitionIterator
2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)at DeviceId.Formatters.HashDeviceIdFormatter.GetDeviceId(IDictionary
2 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(KeyValuePair
2 x)at System.Linq.Enumerable.SelectIPartitionIterator
2.PreallocatingToArray(Int32 count) at System.Linq.Enumerable.SelectIPartitionIterator
2.ToArray()at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source) at DeviceId.Formatters.HashDeviceIdFormatter.GetDeviceId(IDictionary
2 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
The text was updated successfully, but these errors were encountered: