Automapper 已失去 pcl 兼容性

Automapper has lost pcl compatibility

我在 PCL 中使用 Automapper 已经 3 年了,一切正常。

但是从版本 4.2.1 开始,当我尝试将它安装在 PCL 中时,出现以下错误:

Could not install package 'AutoMapper 4.2.1'. 
You are trying to install this package into a project that targets
'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10',
but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

有没有我遗漏的新东西?

谢谢大家

AutoMapper 4.2.1 不支持 Windows Phone 8 (wp80)。这里 wp80 是基于 Silverlight 的 Windows Phone 目标框架。因此,您的便携式 class 库项目的配置文件不兼容。查看 AutoMapper 4.2.1,NuGet 包有一个 PCL 目录:

portable-net45+win+wpa81+MonoAndroid10+Xamarin.iOS10+MonoTouch10

Xamarin 和 Mono 框架是可选的,因此 PCL 配置文件基本上是:

net45+win+wpa81

这是一个支持 .NET 4.5、Windows 8 和 Windows Phone Applications 8.1 的配置文件。这里的 wpa81 是基于 WinRT Windows Phone 的目标框架。此 PCL 个人资料似乎是 Profile111。

因此,为了使用 AutoMapper 4.2.1,您需要更改 PCL 项目的配置文件。您当前的个人资料似乎是 Profile78。如果您切换到 Profile111 或其他兼容的配置文件,那么您应该能够安装 AutoMapper 4.2.1。

或者,您可以使用旧版本的 AutoMapper。 AutoMapper 4.1.0 目标:

net45+win+wpa81+wp8+MonoAndroid10+Xamarin.iOS10+MonoTouch10

支持Profile78。所以看起来最新的 AutoMapper 已经放弃了对 Windows Phone 8 (Silverlight) 的支持。