0

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

user3471528
  • 3,013
  • 6
  • 36
  • 60

1 Answers1

4

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).

Matt Ward
  • 47,057
  • 5
  • 93
  • 94
  • Thank you Matt, Am I able to develop a recently introduced Universal Windows Application using profile 111? – user3471528 Feb 26 '16 at 12:10
  • Universal Windows apps have a NuGet target framework of uwp and whilst AutoMapper does not have that as a specific folder inside its NuGet package NuGet 3 will use the assembly in the dotnet5.1 directory. So the UWP app will not have a PCL profile. You can reference a PCL project that has a Profile of 111 from a UWP project. – Matt Ward Feb 26 '16 at 13:30