如何在.NET 4.6.1项目中添加Newtonsoft 9.0.1?

时间:2016-07-04 19:40:30

标签: c# asp.net .net json.net

我无法通过Newtonsoft 9.0.1在4.6.1项目中安装nuget个软件包。在.NET Core项目中似乎没问题。

错误讯息:

enter image description here


    PM> Install-Package Newtonsoft.Json -verbose

    GET https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json'
    OK https://www.nuget.org/api/v2/FindPackagesById()?id='Newtonsoft.Json' 179ms

    Attempting to gather dependency information for package 'Newtonsoft.Json.9.0.1' with respect to project 'ClassLibrary1', targeting '.NETFramework,Version=v4.6.1'
    Package Newtonsoft.Json from source nuget.org gathered from cache.
    Total number of results gathered : 2
    Gathering dependency information took 1,32 ms
    Summary of time taken to gather dependencies per source :
    Attempting to resolve dependencies for package 'Newtonsoft.Json.9.0.1' with DependencyBehavior 'Lowest'
    Resolving dependency information took 0 ms
    Resolving actions to install package 'Newtonsoft.Json.9.0.1'
    Resolved actions to install package 'Newtonsoft.Json.9.0.1'
    Retrieving package 'Newtonsoft.Json 9.0.1' from 'nuget.org'.
    For adding package 'Newtonsoft.Json.9.0.1' to project 'ClassLibrary1' that targets 'net461'.
    For adding package 'Newtonsoft.Json.9.0.1' to project 'ClassLibrary1' that targets 'net461'.
    Adding package 'Newtonsoft.Json.9.0.1' to folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages'
    Added package 'Newtonsoft.Json.9.0.1' to folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages'
    Install failed. Rolling back...
    Package 'Newtonsoft.Json.9.0.1' does not exist in project 'ClassLibrary1'
    Removing package 'Newtonsoft.Json.9.0.1' from folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages'
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib\portable-net40+sl5+wp80+win8+wpa81'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib\netstandard1.0'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib\net20'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib\net35'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib\net40'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib\net45'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\tools'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1\lib'.
    Removed file 'Newtonsoft.Json.9.0.1.nupkg' from folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1'.
    Removed folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages\Newtonsoft.Json.9.0.1'.
    Removed package 'Newtonsoft.Json.9.0.1' from folder 'C:\Users\robson.silva\documents\visual studio 2015\Projects\ClassLibrary1\packages'
    Executing nuget actions took 548,1 ms
    Install-Package : Failed to add reference to 'Newtonsoft.Json'.
    At line:1 char:1
    + Install-Package Newtonsoft.Json -verbose
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

    Time Elapsed: 00:00:01.6617616

这是Newtonsoft版本中的错误吗?

0 个答案:

没有答案