NuGet 包管理器:“AutoMapper"已经为“Microsoft.CSharp"定义了依赖项

NuGet Package Manager: #39;AutoMapper#39; already has a dependency defined for #39;Microsoft.CSharp#39;(NuGet 包管理器:“AutoMapper已经为“Microsoft.CSharp定义了依赖项)
本文介绍了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

我应该检查什么?

推荐答案

好像是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"定义了依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)