Xamarin.iOS linker and reflection issue


In my Xamarin.iOS project I need to reduce the assembly size (Apple’s requirement for AppStore applications), and I need to turn on linker, setting the linker behavior either to "Link Framework SDKs only" or "Link All".

When I’ve selected "Link Framework SDKs only" in Linker behavior I get the compilation error upon building the project:

Can’t resolve the reference ‘System.Void System.Data.SqlClient.SqlCommandBuilder::DeriveParameters(System.Data.SqlClient.SqlCommand)’,
referenced from the method ‘System.Void DevExpress.Xpo.DB.MSSqlConnectionProvider::CommandBuilderDeriveParameters(System.Data.IDbCommand)’
in ‘System.Data.SqlClient, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

To fix this issue all answers I have found recommend to turn "Link All" option in the Linker behaviour option.

When I’ve selected "Link All", the project compiles okay, but at the runtime I get system exception on the IoC Container code (type AAA does not implement the interface BBB), because I use reflection, and linker with "Link All" options affects the code with the reflection. And as far as I know this linker option (Link All) is not recommended for the projects where reflection is being used.

What options do I have at this point?

Source: Xamarin.ios Questions

Categorised as Uncategorised Tagged , ,


Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us