Error: Could not load file or assembly Microsoft.Management.Infrastructure
See original GitHub issueDeviceId: 5.3.0 Running the app on windows 10 I have the following error:
Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
File name: 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at DeviceId.Internal.Wmi.GetValues(String className, String propertyName)
at DeviceId.Components.WmiDeviceIdComponent.GetValue()
at DeviceId.Formatters.HashDeviceIdFormatter.<>c.<GetDeviceId>b__3_1(IDeviceIdComponent 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(IEnumerable`1 components)
at DeviceId.DeviceIdBuilder.ToString()
My code looks like this:
var systemId = new DeviceIdBuilder()
.AddProcessorId()
.AddMotherboardSerialNumber()
.AddSystemUUID()
.AddOSInstallationID()
.UseFormatter(new HashDeviceIdFormatter(() => MD5.Create(), new Base64UrlByteArrayEncoder()))
.ToString();
Is it a bug or am I doing something wrong? Appreciate any help.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Running Powershell from .Net Core - Could not load file or ...
Problem is probably caused by the fact, that under C:\Users\UserName\.nuget\packages\microsoft.management.infrastructure\1.0.0\runtimes there ...
Read more >Import-Module : Could not load file or assembly 'System. ...
I'm unable to run PnP PowerShell commands using PowerShell ISE in administrative mode. Getting following error PS C:\WINDOWS\system32> ...
Read more >System.IO.FileNotFoundException: Could not load file or ...
But when i deploy to IIS in production i keep getting: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.
Read more >Could not load file or assembly 'Microsoft.Management ...
I did some research and figured the following: Answer 1: There is no Runtime identifer specific Microsoft.Management.Infrastructure.dll files in the ...
Read more >Missing assemblies in publish output
System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, I switched to v6.0 and the following example is working on Windows (runtime
win-x64
) 👍Thanks a lot for your help. 🥇
Glad you got it going!