Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Marshal.PtrToStructure support in reflection free Native AOT #70837

@Fabi

Description

@Fabi

Hey,

while working on a project/lib and tried to make it reflection free I noticed that Marshal.PtrToStructure actually throws "Reflection_Disabled" due to it's usage of Activator.CreateInstance. Marshal.StructureToPtr works fine though.

That makes functions like NetworkInterface.GetAllNetworkInterfaces that result in SystemNetworkInterface.GetNetworkInterfaces calls unusable in reflection free mode.

Are there any plans to fix that or any (safe) alternatives?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions