MonoTouch debugging not creating with ServiceStack.Text (AOT error)?

I just started using ServiceStack.Text.MonoTouch.dll in my MonoTouch solution. Everything compiles and runs in the simulator, but as soon as I try to run the Debug assembly on the phone, the compilation process dies with the following error: error MT3001: the assembly '... / ServiceStack.Text.MonoTouch.dll' failed

I read this because of too much or too much of the ServiceStack.Text data. So I tried in release mode, and everything works because LLVM is turned on, and the linker refers to "Link SDK assemblysies only".

This is problematic since I cannot debug the device. In debug mode, the linker is disabled, and LLVM is disabled. Is there any way around this?

MT 6.0.8 & latest version of ServiceStack dll from Github.

+4
source share
1 answer

In debug mode, the linker is disabled,

No (at least not by default).

By default, the managed linker is enabled (Link SDK) for all device assemblies (debugging or release). However, by default (Link SDK) it will not be possible to remove unused code from ServiceStack.Text.dll , since this assembly is not an SDK assembly.

You need to switch the option to Link all assemblies to make sure that it is being processed.

Note that you may need to add the [Preserve] attributes (or --linkskip=ASSEMBLY ) to your own code if it is not a reliable linker (for example, using reflection). See an example for an example.

+1
source

All Articles