NuGet Package Manager: #39;AutoMapper#39; already has a dependency defined for #39;Microsoft.CSharp#39;(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"定义了依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:NuGet 包管理器:“AutoMapper"已经为“Microsoft.CSharp"定义了依赖项


- C# 中多线程网络服务器的模式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 输入按键事件处理程序 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01