2010-01-20 2 views
1

MonoTouch를 사용하여 빌드 한 iPhone 앱의 시뮬레이터 빌드에서 resx 파일을로드하고 액세스 할 수 있습니다. 의 .resx 파일 자체는이 같은 항목이MonoTouch : iPhone 빌드에 포함 된 resx 파일 사용

<ItemGroup> 
    <EmbeddedResource Include="MapMenu\Resources\MapMenu.resx"> 
     <Generator>ResXFileCodeGenerator</Generator> 
     <LastGenOutput>MapMenu.Designer.cs</LastGenOutput> 
    </EmbeddedResource> 
    </ItemGroup> 

:

<data name="Main_Menu" type="System.Resources.ResXFileRef, System.Windows.Forms"> 
    <value>Main Menu.mm;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value> 
    </data> 

및 생성 된 MapMenu.Designer.cs 파일이 있습니다

를 같은 csproj 파일의 RESX 파일 항목 보인다
internal static string Main_Menu { 
     get { 
      return ResourceManager.GetString("Main_Menu", resourceCulture); 
     } 
    } 

위에서 언급 한 것처럼 Main_Menu 호출자를 호출하면 시뮬레이터에서 정상적으로 작동합니다. 장치에, 그러나, 그것은 생산 :

<Notice>: Unhandled Exception: System.MissingMethodException: No constructor found for System.Resources.RuntimeResourceSet::.ctor(System.IO.UnmanagedMemoryStream) 
<Notice>: at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
<Notice>: at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
<Notice>: at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 
<Notice>: at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) [0x00000] in <filename unknown>:0 
<Notice>: at System.Resources.ResourceManager.GetString (System.String name, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
<Notice>: at MapMenu.Resources.MapMenu.get_Main_Menu() [0x00000] in <filename unknown>:0 

몇 정신 검사를했고,이 정말 Monotouch의 기능을없는 경우이 시점에서 궁금.

감사합니다,

답변

1

그것은 단지 자원 로더 코드에 의한 반사를 통해 호출되는 생성자를 제거 링커의 버그처럼 보인다. 해결 방법으로, 당신도 직접 엠 터치를 사용하는 경우 -nolink 사용하거나 MonoDevelop에서 링커 옵션을 지정하여 (링커를 사용하지 않도록 설정할 수 있습니다.

file a bug하십시오.

관련 문제