I'm using Automapper in a PCL for 3 years and everything was working well.
But since version 4.2.1 when I try to install it in a PCL I get the following error:
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.
Is there something new that I'm missing?
Thanks guys
AutoMapper 4.2.1 does not support Windows Phone 8 (wp80). Here wp80 is the Silverlight based Windows Phone target framework. So your portable class library project's profile is incompatible. Looking at AutoMapper 4.2.1 the NuGet package has a PCL directory of:
portable-net45+win+wpa81+MonoAndroid10+Xamarin.iOS10+MonoTouch10
The Xamarin and Mono frameworks are optional so the PCL profile is basically:
net45+win+wpa81
So that is a profile that supports .NET 4.5, Windows 8 and Windows Phone Applications 8.1. Here wpa81 is the WinRT based Windows Phone target framework. This PCL profile seems to be Profile111.
So in order to use AutoMapper 4.2.1 you will need to change your PCL project's profile. Your current profile seems to be Profile78. If you switch to Profile111 or another compatible profile then you should be able to install AutoMapper 4.2.1.
Alternatively you can use an older version of AutoMapper. AutoMapper 4.1.0 targets:
net45+win+wpa81+wp8+MonoAndroid10+Xamarin.iOS10+MonoTouch10
Which supports Profile78. So it looks like the latest AutoMapper has dropped support for Windows Phone 8 (Silverlight).