Reloaded.Hooks
Reloaded.Hooks copied to clipboard
Using hooks from a native AOT library
Description
I'm trying to use Reloaded.Hooks
in a project with Ahead-Of-Time (AOT) compilation, but it appears that hook generation needs runtime reflection. Additionally, the trimmer seems to strip away important types like Reloaded.Memory.Sources.IMemory
. This issue complicates the use of Reloaded.Hooks
in AOT scenarios.
Would it be possible to provide reflection-less & trimming-friendly hooks?
Use Case
I am running the hooker outside the regular Reloaded-II runtime/injector, and instead, compiling as a native dinput8.dll
proxy that's placed in the target folder. See here
Expected Behavior:
An AOT compiled project depending on Reloaded.Hooks
should build without warnings and install hooks without runtime exceptions.
Actual Behavior
The application builds with warnings, and at runtime, it fails to load Reloaded.Memory.Sources.IMemory
on new Hook<T>()
due to the trimming process removing necessary components.