Skip to content

Commit 90461a2

Browse files
[release/7.0] Fix System.Management wminet_utils.dll lookup code for 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>
1 parent 1e9466d commit 90461a2

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<!-- Reference the outputs for the dependency nodes calculation. -->
66
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
77
<IsPackable>true</IsPackable>
8+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9+
<ServicingVersion>1</ServicingVersion>
810
<!-- This is a meta package and doesn't contain any libs. -->
911
<NoWarn>$(NoWarn);NU5128</NoWarn>
1012
<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>

src/libraries/System.Management/src/System.Management.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<Nullable>annotations</Nullable>
1010
<IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
1111
<IsPackable>true</IsPackable>
12+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
13+
<ServicingVersion>1</ServicingVersion>
1214
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
1315
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
1416
<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.

src/libraries/System.Management/src/System/Management/ManagementScope.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ internal enum APTTYPE
290290
static WmiNetUtilsHelper()
291291
{
292292
RegistryKey netFrameworkSubKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework\");
293-
string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue("InstallRoot");
293+
string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue(RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ?
294+
"InstallRootArm64" :
295+
"InstallRoot");
294296

295297
if (netFrameworkInstallRoot == null)
296298
{

src/libraries/System.Management/tests/WmiTestHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class WmiTestHelper
1111
private static readonly bool s_isElevated = AdminHelpers.IsProcessElevated();
1212
private static readonly bool s_isWmiSupported =
1313
PlatformDetection.IsWindows &&
14-
PlatformDetection.IsNotArmNorArm64Process &&
14+
PlatformDetection.IsNotArmProcess &&
1515
PlatformDetection.IsNotWindowsNanoServer &&
1616
PlatformDetection.IsNotWindowsIoTCore &&
1717
!PlatformDetection.IsInAppContainer;

0 commit comments

Comments
 (0)