-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
area-System.Managementlinkable-frameworkIssues associated with delivering a linker friendly frameworkIssues associated with delivering a linker friendly framework
Milestone
Description
Description
NativeAOT (the trimming?) breaks the body of System.Management.WbemDefPath..ctor():
---> System.InvalidProgramException: Common Language Runtime detected an invalid program. The body of method 'Void System.Management.WbemDefPath..ctor()' is invalid.
at Internal.Runtime.TypeLoaderExceptionHelper.CreateInvalidProgramException(ExceptionStringID, String) + 0x40
at Internal.Runtime.CompilerHelpers.ThrowHelpers.ThrowInvalidProgramExceptionWithArgument(ExceptionStringID, String) + 0x9
at System.Management.WbemDefPath..ctor() + 0x15
I'm reporting this here since NativeAOT will be moved into this repo anyway and it's probably a trimming issue? in which case it belongs to this repo.
Reproduction Steps
In nativeAOT project:
ManagementClass managementClass = new ManagementClass("Win32_BaseBoard");
var instances = managementClass.GetInstances();
foreach (var obj in instances)
{
//...
}
In C# project call the export function of the nativeAOT project which executes the code above.
Expected behavior
No exception
Actual behavior
Exception
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
It's a windows x64 DLL project publishing using /p:NativeLib=Shared
, I'm using NativeAOT compiler nuget version 6.0.0-*
natan-abolafya, Sing303, styris-ame and colejohnson66
Metadata
Metadata
Assignees
Labels
area-System.Managementlinkable-frameworkIssues associated with delivering a linker friendly frameworkIssues associated with delivering a linker friendly framework