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

前端 未结 10 1647
迷失自我
迷失自我 2020-11-30 04:47

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 faile

相关标签:
10条回答
  • 2020-11-30 05:05

    This looks like a mismatch between the .NET version used by the Automapper package and your project. Can you confirm the .NET version that your project is using?

    0 讨论(0)
  • 2020-11-30 05:11

    I ended up needing to update NuGet.exe that was included in the solution to be able to build NuGet packages by running:

    nuget.exe update -self

    0 讨论(0)
  • 2020-11-30 05:12

    I had the same issue on VS2013. I had to update to VS2013 Update 5 and get the latest nuget distro for VS2013 at https://dist.nuget.org/visualstudio-2013-vsix/v2.12.0/NuGet.Tools.vsix

    Once that was done, I rebooted Visual Studio. After that I was able to use the Automapper 5.0.2 package

    0 讨论(0)
  • 2020-11-30 05:14

    Removed both CSharp and AutoMapper. Installed CSharp (4.0.0.0) first and then added Automapper (6.1.1.0). This resolved the problem for me.

    0 讨论(0)
提交回复
热议问题