pomber pomber - 1 year ago 604
C# Question

NuGet Package Manager: 'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'

I'm trying to add AutoMapper as a dependency to a project using NuGet on Visual Studio Premium 2012, but it fails.

It says:

Operation failed

'AutoMapper' already has a dependency defined for

I'm able to add other dependencies.

I'm using the last version of the package manager for VS 2012:

NuGet Package Manager 2.8.60318.667

Any ideas what should I check?

Answer Source

Seems to be a problem with the current version of automapper:

AutoMapper 5.0.0 Tuesday, June 28, 2016

I tried with the previous version and it works:

PM> Install-Package AutoMapper -Verbose
Install-Package : 'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'.
At line:1 char:16
+ Install-Package <<<<  AutoMapper -Verbose
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

PM> Install-Package AutoMapper -Version 4.2.1
Installing 'AutoMapper 4.2.1'.
Successfully installed 'AutoMapper 4.2.1'.

So the answer is:

PM> Install-Package AutoMapper -Version 4.2.1
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download