Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linker Xamarin链接器触发静态类属性?_Linker_Xamarin - Fatal编程技术网

Linker Xamarin链接器触发静态类属性?

Linker Xamarin链接器触发静态类属性?,linker,xamarin,Linker,Xamarin,在VS 2013中,Xamarin形成 我们的Android和IOS应用程序有一个静态类: public static class CacheKeys { public static string RememberMeEmail = "RememberMeEmail"; public static string RememberMeSwitch = "RememberMeSwitch"; } 此类由iOS设备调试生成中的链接器剥离,但不在 模拟器或Android 见附件截图 我

在VS 2013中,Xamarin形成

我们的Android和IOS应用程序有一个静态类:

public static class CacheKeys
{
    public static string RememberMeEmail = "RememberMeEmail";
    public static string RememberMeSwitch = "RememberMeSwitch";
}
此类由iOS设备调试生成中的链接器剥离,但不在 模拟器或Android

见附件截图

我已经将iPhone的调试链接器设置为“不链接”,但是这个静态类是 删除


您可以为类设置保留属性: 请参阅:保留代码一节

例如:

[Preserve]
    public static class LinkerPreserve
    {
        static LinkerPreserve()
        {
            throw new Exception(typeof(SQLitePersistentBlobCache).FullName);
        }
    }

    public class PreserveAttribute : Attribute
    {
    }

我还发现我必须检查“iOS构建”的高级选项卡中的“启用通用值类型共享”