-
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
Use MMI instead of System.Management for dotnet core #25
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add FileDeviceIdComponent, RegistryValueDeviceIdComponent and UnsupportedDeviceIdComponent.
* Ensure multi-values are sorted. * Return null rather than empty string or "NoValue" when no value is present. * Treat null values as empty strings when encoding.
* Use System.Text.Json instead of Newtonsoft. * Don't include the dependency in the .NET 4 build, as it's not needed.
Previously WmiDeviceIdComponent queried all properties from the class. Now it only queries one property specified by _wmiProperty which makes the whole process near-instant.
And by "error handling" I just mean silently swallowing exceptions.
The following components are added: * ProcessorId (as Apple Serial Number) * SystemDriveSerialNumber
It didn't really fit under ProcessorId. It doesn't really fit in OSInstallationID either but it's a slightly better option.
… instead of deprecated System.Management Add DeviceIdComponentFailedToObtainValueException to indicate when a component can't be obtained (as opposed to having an empty or null value)
… instead of deprecated System.Management Add DeviceIdComponentFailedToObtainValueException to indicate when a component can't be obtained (as opposed to having an empty or null value)
Hi. Thanks for this PR - it looks very useful. Are you able to rebase it on the top of the current branch so it's a bit easier to review and merge please? Thanks in advance. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to fix a problem where using a self-contained dotnet core application that uses System.Management requires specific dotnet framework to be installed on the machine (see here). Instead, we use MMI which is the recommended way. This still fails on some machine, such as Windows 7 SP1 without WMF3.0 installed so changes were made to fail silently and only use obtainable information when creating DeviceId.