меня PCL, где я с помощью AutoMapper 5.1.1 с кодом: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. Спасибо