zoukankan      html  css  js  c++  java
  • VS2012 Nuget 安装 AutoMapper时报错的解决方法

    VS2012 在.net 4.0下安装AutoMapper时,会报以下错误:

    “AutoMapper”已拥有为“Standard.Library”定义的依赖项。

    'AutoMapper' already has a dependency defined for 'Standard.Library'.

    经查应该是Nuget版本(VS2012的2.83版本)较低引起的,不支持Standard.Library框架。

    解决方法有两个:

    方式一
    NuGet 2.12支持AutoMapper 5.0.1 NuGet 包使用的.NETStandard框架,所以需要把NuGet升级为NuGet 2.12 或以上。
    但NuGet2.12是不支持Visual Studio 2012,所以也需要把Visual Studio升级为2013。

    方式二(采用)
    降级AutoMapper的版本到兼容当前版本的NuGet,经测试4.1.1完美安装上,并且顺带安装了Microsoft.Bcl,可以使用.Net4.5的await和 async了
    PM> Install-Package AutoMapper -Version 4.1.1
    Installing 'AutoMapper 4.1.1'.
    Successfully installed 'AutoMapper 4.1.1'.

    参考:

    http://majing.io/questions/557

  • 相关阅读:
    spring boot 配置时区差别
    概率期望
    Euler函数与Euler定理
    素数&筛法
    等差子序列
    8.19 T2
    8.19 T1
    量化交易
    挺进

  • 原文地址:https://www.cnblogs.com/yanglang/p/7065049.html
Copyright © 2011-2022 走看看