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)
还有什么问题呢?
你确定所有的程序集都被复制了吗?基于[this]猜测(https://github.com/AutoMapper/AutoMapper/issues/370#ref-issue-12520648) – rene 2014-10-05 18:19:47
有没有想过这个呢? ive继承了一个xamarin项目,当我试图发布一个新版本即时通讯获得类似的错误 – InitLipton 2015-06-19 15:42:38
@InitLipton,没有抱歉,我不记得原因是什么。很可能是以后版本中已修复的XS Studio错误。自从我发布这个问题以来没有经历过。 – 2015-06-20 17:11:41