You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System.Management.dll not working on win-arm64 #81400
It appears to be trying to load the native library from Framework64 when it should be loading it from FrameworkArm64:
Unhandled exception. System.TypeInitializationException: The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception.
---> System.ComponentModel.Win32Exception (193): Failed to load required native library 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\wminet_utils.dll'.
at System.Management.WmiNetUtilsHelper..cctor()
--- End of inner exception stack trace ---
at System.Management.MTAHelper.IsNoContextMTA()
at System.Management.MTAHelper.CreateInMTA(Type type)
at System.Management.ManagementPath.CreateWbemPath(String path)
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementScope..ctor(String path)
at Program.<Main>$(String[] args) in C:\Users\slee\test\wmi\Program.cs:line 1
This is likely not a regression, but rather something that never worked but can now that we have an Arm64 .NET Framework. @SteveL-MSFT how urgent is a fix here?
@ericstj I don't think it's super urgent, but the original issue was reported by a customer. If it can be addressed within the next couple of months, I think that would be fine.
I don't think it's super urgent, but the original issue was reported by a customer. If it can be addressed within the next couple of months, I think that would be fine.
Note this was actually reported in Oct 2021 in 59844. so a "couple of months" has definitely passed
WMINet_utils is a native binary and I believe requires machine-wide registration/installation to work correctly. It also has never been open sourced, so it would need to go through that process. On top of that the component isn't owned by .NET so it would require some help/permission from the owning team to see that happen assuming such a port was even possible. That's all out of the scope of this issue and tracked by #66386.
I have done few changes as per previous comments, enabled unit test for ARM64, added one test case for this particular issue. Not sure if this solution is correct or not, hence wanted to check, attaching my changes and unit test case and its results in both ARM64 and X64 .NetCore81400.zip
As shared above, I'll be working on a fix this week and we will then bring it to our shiproom for backport approval. I can't share when this would then be available but likely not before May.
EDIT: We got this into the April servicing release so updated packages with the change will be available mid April.
Reacted by Dharmateja-Challa-Dell
ghost added
in-prThere is an active PR which will close this issue when it is merged
Activity
smasher164 commentedon Feb 6, 2023
Could be related: #59844
/cc @ericstj @danmoseley
ViktorHofer commentedon Feb 6, 2023
We probably need to update the lookup code that finds the .NET Framework installation (kudos to @ericstj):
runtime/src/libraries/System.Management/src/System/Management/ManagementScope.cs
Line 292 in 2327a36
ericstj commentedon Feb 6, 2023
If possible, we should also re-enable tests on ARM64 while doing this.
runtime/src/libraries/System.Management/tests/WmiTestHelper.cs
Line 14 in 59f7daf
This wasn't possible in the past when we didn't have an ARM64 .NETFramework. Now that we do, we should make it work 👍
ericstj commentedon Feb 9, 2023
This is likely not a regression, but rather something that never worked but can now that we have an Arm64 .NET Framework. @SteveL-MSFT how urgent is a fix here?
SteveL-MSFT commentedon Feb 13, 2023
@ericstj I don't think it's super urgent, but the original issue was reported by a customer. If it can be addressed within the next couple of months, I think that would be fine.
SimonCropp commentedon Feb 26, 2023
isnt this a duplicate of #59844?
just a head up that this also breaks
since they will all be hit by VerifyTests/DiffEngine#315
Nuklon commentedon Feb 27, 2023
Can't we ship that DLL with .NET Core instead? It would be much better than relying on .NET Framework being installed.
SimonCropp commentedon Feb 27, 2023
@SteveL-MSFT
Note this was actually reported in Oct 2021 in 59844. so a "couple of months" has definitely passed
JamesWCCheng commentedon Mar 1, 2023
I also encountered this problem by using the latest
runtime/src/libraries/System.Management/src/System/Management/ManagementScope.cs
Line 305 in 2327a36
[Experimental change]
If I set registry InstallRoot from C:\Windows\Microsoft.NET\Framework64\ to C:\Windows\Microsoft.NET\FrameworkArm64\
ARM64 process with WMI works fine.
I think it's a simple change, I'm looking forward to seeing it gets fixed soon.
7 remaining items
ericstj commentedon Mar 13, 2023
WMINet_utils is a native binary and I believe requires machine-wide registration/installation to work correctly. It also has never been open sourced, so it would need to go through that process. On top of that the component isn't owned by .NET so it would require some help/permission from the owning team to see that happen assuming such a port was even possible. That's all out of the scope of this issue and tracked by #66386.
Dharmateja-Challa-Dell commentedon Mar 14, 2023
I have done few changes as per previous comments, enabled unit test for ARM64, added one test case for this particular issue. Not sure if this solution is correct or not, hence wanted to check, attaching my changes and unit test case and its results in both ARM64 and X64
.NetCore81400.zip
ViktorHofer commentedon Mar 14, 2023
@Dharmateja-Challa-Dell I won't open you attachment. Can you please let me know what your comment refers to?
danmoseley commentedon Mar 14, 2023
@Dharmateja-Challa-Dell if you want to share a proposed change please do it by pushing a branch to your fork and sending a link to that.
Silve2611 commentedon Mar 15, 2023
This is also a critical error for us. When can we expect for that it will be resolved? Do you have a timeframe?
Dharmateja-Challa-Dell commentedon Mar 15, 2023
ViktorHofer commentedon Mar 15, 2023
As shared above, I'll be working on a fix this week and we will then bring it to our shiproom for backport approval. I can't share when this would then be available but likely not before May.
EDIT: We got this into the April servicing release so updated packages with the change will be available mid April.
SimonCropp commentedon Apr 12, 2023
was this included in v6.0.1? https://www.nuget.org/packages/System.Management/6.0.1
ViktorHofer commentedon Apr 12, 2023
Yes, the fix is part of the following package versions:
SimonCropp commentedon Apr 12, 2023
@ViktorHofer thanks