Skip to content

Commit

Permalink
[release/7.0] Fix System.Management wminet_utils.dll lookup code for …
Browse files Browse the repository at this point in the history
…arm64 (#83549)

* Fix System.Management wminet_utils.dll lookup code for arm64

* Update ManagementScope.cs

* Update System.Management.csproj

* Update Microsoft.Windows.Compatibility.csproj

---------

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
  • Loading branch information
github-actions[bot] and ViktorHofer authored Mar 17, 2023
1 parent 1e9466d commit 90461a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!-- Reference the outputs for the dependency nodes calculation. -->
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<!-- This is a meta package and doesn't contain any libs. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.</PackageDescription>
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Management/src/System.Management.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<Nullable>annotations</Nullable>
<IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
<PackageDescription>Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ internal enum APTTYPE
static WmiNetUtilsHelper()
{
RegistryKey netFrameworkSubKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework\");
string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue("InstallRoot");
string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue(RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ?
"InstallRootArm64" :
"InstallRoot");

if (netFrameworkInstallRoot == null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Management/tests/WmiTestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class WmiTestHelper
private static readonly bool s_isElevated = AdminHelpers.IsProcessElevated();
private static readonly bool s_isWmiSupported =
PlatformDetection.IsWindows &&
PlatformDetection.IsNotArmNorArm64Process &&
PlatformDetection.IsNotArmProcess &&
PlatformDetection.IsNotWindowsNanoServer &&
PlatformDetection.IsNotWindowsIoTCore &&
!PlatformDetection.IsInAppContainer;
Expand Down

0 comments on commit 90461a2

Please sign in to comment.