2014-12-29 2 views
1

VS 2013에서 Xamarin Forms. 아니라 시뮬레이터 또는 Android에서,이 클래스는 아이폰 OS 장치 디버그 빌드에서 링커에 의해 제거됩니다Xamarin Linker가 정적 클래스 속성을 제외 시켰습니까?

public static class CacheKeys 
{ 
    public static string RememberMeEmail = "RememberMeEmail"; 
    public static string RememberMeSwitch = "RememberMeSwitch"; 
} 

:

우리의 안드로이드 & iOS 앱은 정적 클래스가 있습니다.

첨부 된 스크린 샷을 참조하십시오.

iPhone 용 디버그 링커를 링크하지 않음으로 설정했지만이 정적 클래스는 입니다.

????? 보존 코드

예 : http://developer.xamarin.com/guides/ios/advanced_topics/linker/ 이 섹션을 참조하십시오

enter image description here

답변

1

당신은 당신의 클래스에 속성을 보존 설정할 수 있습니다

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

    public class PreserveAttribute : Attribute 
    { 
    } 
1

나는 또한 I "가를 확인주었습니다 'iOS 빌드'의 고급 탭에서 일반 값 유형 공유 사용

관련 문제