Hello Anders,

On Thu, Feb 16, 2012 at 7:34 AM, andersa <[email protected]> wrote:
> Here are my test results:
>
> Simulator - Don't link = Works
> Simulator - Link SDK = Works
> Simulator - Link all = Fails
>
> Device - Don't link = Works
> Device - Link SDK = Works
> Device - Link all = Fails
>
> I'm not sure on how to move further with this now?

The linker is removing something that it could not determine as used
(by your application) using static analysis. You need to protect those
pieces (e.g. used via reflection) using the [Preserve] attribute.

> Is this a linker issue,
> and should I file a report?

You should. First we might be able to help you identify what's wrong
in your specific case (if the attached test case is small enough).

It's also possible we'll be able to enhance the linker in the future,
based on the pattern you use, to reduce the number of [Preserve]
required.

> Newbie question: and are there any scenarios when I should/must link all
> assemblies? Or can I just happily set it to "Don't link" and not worry about
> it anymore?

You never *have* to link - i.e. it's not mandatory. OTOH linking
reduce the total size of your application and it's memory (RAM)
requirements. It will also make your device build faster (in many
case) since there will be less code to AOT (the linker being faster to
remove the code than the AOT compiler process it).

I have several blog entries about the linker:
https://spouliot.wordpress.com/category/linker/
And there are a few documents on Xamarin's web site, e.g.
http://docs.xamarin.com/ios/advanced_topics/linker

Sebastien
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to