2014-10-05 53 views
0

使用Xamarin XS v5.5,AutoMapper v3.2.1, 我在发布版本(未在调试中)中得到此运行时错误:
This type is not supported on this platform INullableConverterFactory为什么我在发布版本中出现此错误:此平台不支持此类型INullableConverterFactory

[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: 
    An exception was thrown by the type initializer for AutoMapper.Mappers.MapperRegistry ---> 
    System.TypeInitializationException: 
    An exception was thrown by the type initializer for AutoMapper.Mappers.EnumMapper ---> 
    System.PlatformNotSupportedException: This type is not supported on this platform INullableConverterFactory 
[mono-rt] at AutoMapper.Internal.PlatformAdapter.Resolve[INullableConverterFactory] (Boolean throwIfNotFound) [0x00000] in <filename unknown>:0 
[mono-rt] at AutoMapper.Mappers.EnumMapper..cctor() [0x00000] in <filename unknown>:0 
[mono-rt] --- End of inner exception stack trace --- 
[mono-rt] at AutoMapper.Mappers.MapperRegistry..cctor() [0x00000] in <filename unknown>:0 
[mono-rt] --- End of inner exception stack trace --- 
[mono-rt] at AutoMapper.Mapper.Reset() [0x00000] in <filename unknown>:0 
[mono-rt] at AutoMapper.Mapper.Initialize (System.Action`1 action) [0x00000] in <filename unknown>:0 
[mono-rt] at MyApp.Android.MainActivity.ConfigMapper() [0x00000] in <filename unknown>:0 
[mono-rt] at MyApp.Android.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00000] in <filename unknown>:0 
[mono-rt] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00000] in <filename unknown>:0 
[mono-rt] at (wrapper dynamic-method) object:3cc570cf-1f33-4513-b6e4-0e910820d0ba (intptr,intptr,intptr) 

还有什么问题呢?

+0

你确定所有的程序集都被复制了吗?基于[this]猜测(https://github.com/AutoMapper/AutoMapper/issues/370#ref-issue-12520648) – rene 2014-10-05 18:19:47

+0

有没有想过这个呢? ive继承了一个xamarin项目,当我试图发布一个新版本即时通讯获得类似的错误 – InitLipton 2015-06-19 15:42:38

+0

@InitLipton,没有抱歉,我不记得原因是什么。很可能是以后版本中已修复的XS Studio错误。自从我发布这个问题以来没有经历过。 – 2015-06-20 17:11:41

回答

0

这是最有可能的连接器去除的AutoMapper组件类型..

通常释放模式有链接设置为SDK组件或全部组件,其中如DEBUG没有做任何链接在这里

检查如何修改什么联系 https://developer.xamarin.com/guides/cross-platform/advanced/custom_linking/

我有同样的异常,并在固定加入这个家伙就

<assembly fullname="AutoMapper"> 
    <type fullname="*INullableConverterFactory*" /> 
    <type fullname="*MappingExpression*" /> 
</assembly> 
相关问题