NuGet 包管理器:“AutoMapper"已经为“Microsoft.CSharp"定义了一个依赖项 [英] NuGet Package Manager: 'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'

查看:29
本文介绍了NuGet 包管理器:“AutoMapper"已经为“Microsoft.CSharp"定义了一个依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 AutoMapper 作为依赖项添加到在 Visual Studio Premium 2012 上使用 NuGet 的项目,但失败了.

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

它说:

操作失败
'AutoMapper' 已经定义了一个依赖项'Microsoft.CSharp'.

Operation failed
'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'.

我可以添加其他依赖项.

I'm able to add other dependencies.

我使用的是最新版本的 VS 2012 包管理器:

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

NuGet 包管理器 2.8.60318.667

NuGet Package Manager 2.8.60318.667

任何想法我应该检查什么?

Any ideas what should I check?

推荐答案

似乎是当前版本的automapper有问题:

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

AutoMapper 5.0.0 2016 年 6 月 28 日,星期二

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

因此,如果您无法更新 NuGet 包管理器,答案是:

So, if you can't update NuGet Package Manager, the answer is:

PM> Install-Package AutoMapper -Version 4.2.1

这篇关于NuGet 包管理器:“AutoMapper"已经为“Microsoft.CSharp"定义了一个依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆