New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marshal.PtrToStructure support in reflection free Native AOT #70837
Comments
We have no plans to make Marshal.PtrToStructure work in reflection-free mode. Duplicate of #67193. However, we are usually happy to take PRs to eliminate |
But isn't this just due to the non generic Activator.CreateInstance usage? The generic one works due to the analyzer catching it and keeping data for it. There is no switch that let us keep data for the non generic function (which calls the non generic one and really not more) |
|
I have fixed up |
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 inSystemNetworkInterface.GetNetworkInterfaces
calls unusable in reflection free mode.Are there any plans to fix that or any (safe) alternatives?
The text was updated successfully, but these errors were encountered: