How to initialize and start the .NET MAUI runtime from an iOS app #112420
-
A sample iOS MAUI app created with Visual Studio Code generates an executable binary and many dlls. I believe the binary contains a .NET runtime/interpreter, in fact, using
I've tried many things:
Theoretically, something can be done because a sample iOS MAUI App has all it needs to run everything and load dll's. How should it be possible to manually load the MAUI runtime from one or more dylib's and then load the main dll? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
What is the source code which is responsible to build the main executable binary of an iOS MAUI app? Perhaps, it is little effort to modify it and to let it link a shared library instead of an executable |
Beta Was this translation helpful? Give feedback.
-
@rolfbjarne maybe you would know if this is at all possible. The only supported runtime on iOS is currently mono and NativeAOT. NativeAOT won't work if you need it to load code dynamically. |
Beta Was this translation helpful? Give feedback.
-
This sounds like a duplicate of dotnet/macios#15217. This is not particularly easy to implement (which is why it hasn't been done), but we're of course happy to help any contributors if someone wants to take on the work. |
Beta Was this translation helpful? Give feedback.
-
The mono runtime has rough library mode support similar to nativeaot by installing the mobile-librarybuilder workload. You'll be able to create a dylib the same way you do in NativeAOT. In any approach library mode approach, I think you're going to run into the limitation of having to stay within the bounds of C#. Using the mono runtime instead of nativeaot can likely get you past the |
Beta Was this translation helpful? Give feedback.
Yes, you're right there are all compilation flags in binlog.
It worked!