0
我有,我使用AutoMapper 5.1.1与代码PCL:AutoMapper 5.1.1 MethodAccessException在Windows Phone 8.1(WinRT的)
var mapperConfig = new MapperConfiguration(cfg =>
{
cfg.AddProfile<TileProfile>();
cfg.AddProfile<PictureProfile>();
...
});
var mapper = mapperConfig.CreateMapper();
与WinForms的工作很好,但是当我使用库的Windows Phone 8.1( WinRT的)然后我得到例外MapperConfiguration构造:
System.MethodAccessException was unhandled by user code
HResult=-2146233072
Message=Attempt by security transparent method 'AutoMapper.Profile..ctor()' to access security critical method 'System.Collections.Concurrent.ConcurrentDictionary`2<System.__Canon,System.__Canon>..ctor()' failed.
Source=AutoMapper
StackTrace:
at AutoMapper.Profile..ctor()
at AutoMapper.Configuration.MapperConfigurationExpression..ctor()
at AutoMapper.MapperConfiguration.Build(Action`1 configure)
at AutoMapper.MapperConfiguration..ctor(Action`1 configure)
InnerException:
我还创建空白的Windows Phone 8.1项目的测试,只有Automapper NuGet包和验证码:
...
public MainPage()
{
this.InitializeComponent();
var mapperConfig = new MapperConfiguration(cfg => {});
}
...
具有相同的结果。 对这个问题有什么经验吗?它看起来像Automapper中的一些错误/内部问题。谢谢