Solution to the error of automapper installation in vs2012 nuget

When vs2012 installs automapper under. Net 4.0, the following error will be reported:

‘automapper’ already has a dependency defined for ‘standard. Library’.

‘AutoMapper’ already has a dependency defined for ‘Standard.Library’.

It is found that the nuget Version (version 2.83 of vs2012) is lower, and the standard. Library framework is not supported.


There are two solutions

Method 1
nuget 2.12 supports the. Net standard framework used by automapper 5.0.1 nuget package, so nuget needs to be upgraded to nuget 2.12 or above downgrade the version of automapper to nuget compatible with the current version. After testing, 4.1.1 is installed perfectly, and microsoft.bcl is installed along with it. Await and async of. Net4.5 can be used
PM & gt; Install-Package AutoMapper -Version 4.1.1
Installing ‘AutoMapper 4.1.1’.
Successfully installed ‘AutoMapper 4.1.1’.

reference resources:

Reproduced in:

Read More: