How to make external C# dll library loadable (reflection) on iPhone?


My dll is generated from a simple class:

  using UnityEngine;

  public class TestDll : MonoBehaviour {
  	public void Awake() {
        Debug.Log("-> TestDll.Awake()");
  	public void Start() {
        Debug.Log("-> TestDll.Start()");
    public void Test() {
        Debug.Log("-> TestDll.Text()");

I put the dll under application’s Document folder on iPhone, and use folloing
code to load it:

  Assembly assem = Assembly.Load(File.ReadAllBytes(Application.persistentDataPath + "/TestDll.dll"));

But I got error:

Non platform assembly: data-0x31c7e00 (this message is harmless)
Failed to load AOT module ‘data-0x31c7e00.dylib’ in aot-only mode.

Then I did “mono --aot=full Test.dll” in Cygwin, and replaced it on iPhone, I
got another error:

Non platform assembly:
data-0xb16b000 (this message is
harmless) Unhandled Exception:

I googled, but didn’t find answers.

Has anyone tried the same thing before? How did you make it?

Thank you

NoWay. IOS limit dynamic code. Can’t add code runtime.