Skip to content

Commit 32c3904

Browse files
github-actions[bot]ViktorHofercarlossanlop
authored
[release/6.0] Fix System.Management wminet_utils.dll lookup code for arm64 (#83546)
* Fix System.Management wminet_utils.dll lookup code for arm64 * Update ManagementScope.cs * Update System.Management.csproj * Update Microsoft.Windows.Compatibility.csproj * Add missing assembly reference. --------- Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com> Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
1 parent 43bb599 commit 32c3904

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<!-- Reference the outputs for the dependency nodes calculation. -->
66
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
77
<IsPackable>true</IsPackable>
8-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
9-
<ServicingVersion>3</ServicingVersion>
8+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9+
<ServicingVersion>4</ServicingVersion>
1010
<!-- This is a meta package and doesn't contain any libs. -->
1111
<NoWarn>$(NoWarn);NU5128</NoWarn>
1212
<PackageDescription>This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.</PackageDescription>

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netcoreapp3.1-windows;netcoreapp3.1;netstandard2.0</TargetFrameworks>
77
<IsPackable>true</IsPackable>
88
<!-- If you enable GeneratePackageOnBuild for this package and bump ServicingVersion, make sure to also bump ServicingVersion in Microsoft.Windows.Compatibility.csproj once for the next release. -->
9-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
10-
<ServicingVersion>0</ServicingVersion>
9+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
10+
<ServicingVersion>1</ServicingVersion>
1111
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
1212
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
1313
<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.
@@ -80,6 +80,7 @@ System.Management.SelectQuery</PackageDescription>
8080
<Reference Include="System.Runtime" />
8181
<Reference Include="System.Runtime.Extensions" />
8282
<Reference Include="System.Runtime.InteropServices" />
83+
<Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
8384
<Reference Include="System.Threading" />
8485
<Reference Include="System.Threading.Thread" />
8586
<Reference Include="System.Threading.ThreadPool" />

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ internal enum APTTYPE
293293
static WmiNetUtilsHelper()
294294
{
295295
RegistryKey netFrameworkSubKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework\");
296-
string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue("InstallRoot");
296+
string netFrameworkInstallRoot = (string)netFrameworkSubKey?.GetValue(RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ?
297+
"InstallRootArm64" :
298+
"InstallRoot");
297299

298300
if (netFrameworkInstallRoot == null)
299301
{

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

+1-1
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)