Xamarin iOS Linker Issue

前端 未结 1 1329
忘掉有多难
忘掉有多难 2021-01-17 03:32

I have an application that has an android and ios project with shared code. The android application works perfect and uses the SDK Only linker. I also have a Linker file to

相关标签:
1条回答
  • 2021-01-17 04:21

    If you are using "Link SDK assemblies only" option on iOS project, then all of those --linkskip arguments won't do anything as only the SDK assemblies are being linked. So the EntityFrameworkCore might be using something that is being linked away that is in the Xamarin.iOS SDK assemblies. System.Linq is part of the SDK and adds extension methods for many database types.

    So I think you may be hitting this issue: https://github.com/xamarin/xamarin-macios/issues/3394

    If so, try putting:

    [assembly: Preserve (typeof (System.Linq.Queryable), AllMembers = true)]
    

    in the Main.cs file of the iOS project outside of the namespace, e.g.:

    using UIKit;
    
    [assembly: Preserve (typeof (System.Linq.Queryable), AllMembers = true)]
    namespace
    {
        ...
    }
    
    0 讨论(0)
提交回复
热议问题