DotNet CLI - 无法恢复包

时间:2016-04-22 07:13:06

标签: dotnet-cli

我有一个与dnu和dnx一起使用的项目,但我遇到了使用新的DotNet CLI恢复软件包的问题:

project.json

{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true
    },
    "dependencies": {
        "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
        "Microsoft.AspNet.Hosting": "1.0.0-rc1-final"
    },
    "frameworks": {
        "dnx451": {},
        "dnxcore50": {}
    },
    "commands": {
        "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000"
    },
    "exclude": [
        "wwwroot",
        "node_modules"
    ]
}

命令行输出

Arrakis:AndaronWebApp Santhos$ dotnet restore
log  : Restoring packages for /Users/Santhos/Projects/andaron/src/AndaronWebApp/project.json...
error: System.Diagnostics.Debug 4.0.11-beta-23516 provides a compile-time reference assembly for System.Diagnostics.Debug on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Diagnostics.TraceSource 4.0.0-beta-23516 provides a compile-time reference assembly for System.Diagnostics.TraceSource on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Net.Primitives 4.0.11-beta-23516 provides a compile-time reference assembly for System.Net.Primitives on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Runtime.Extensions 4.0.11-beta-23516 provides a compile-time reference assembly for System.Runtime.Extensions on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Threading 4.0.11-beta-23516 provides a compile-time reference assembly for System.Threading on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Console 4.0.0-beta-23516 provides a compile-time reference assembly for System.Console on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.IO.FileSystem.Watcher 4.0.0-beta-23516 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.IO.FileSystem 4.0.1-beta-23516 provides a compile-time reference assembly for System.IO.FileSystem on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Globalization.Extensions 4.0.1-beta-23516 provides a compile-time reference assembly for System.Globalization.Extensions on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Linq.Expressions 4.0.11-beta-23516 provides a compile-time reference assembly for System.Linq.Expressions on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Security.Cryptography.X509Certificates 4.0.0-beta-23516 provides a compile-time reference assembly for System.Security.Cryptography.X509Certificates on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Security.Cryptography.Algorithms 4.0.0-beta-23516 provides a compile-time reference assembly for System.Security.Cryptography.Algorithms on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: System.Security.Cryptography.Encoding 4.0.0-beta-23516 provides a compile-time reference assembly for System.Security.Cryptography.Encoding on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
error: Some packages are not compatible with DNXCore,Version=v5.0 (osx.10.11-x64).
info : Committing restore...
log  : Restore failed in 1012ms.

Errors in /Users/Santhos/Projects/andaron/src/AndaronWebApp/project.json
    System.Diagnostics.Debug 4.0.11-beta-23516 provides a compile-time reference assembly for System.Diagnostics.Debug on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Diagnostics.TraceSource 4.0.0-beta-23516 provides a compile-time reference assembly for System.Diagnostics.TraceSource on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Net.Primitives 4.0.11-beta-23516 provides a compile-time reference assembly for System.Net.Primitives on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Runtime.Extensions 4.0.11-beta-23516 provides a compile-time reference assembly for System.Runtime.Extensions on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Threading 4.0.11-beta-23516 provides a compile-time reference assembly for System.Threading on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Console 4.0.0-beta-23516 provides a compile-time reference assembly for System.Console on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.IO.FileSystem.Watcher 4.0.0-beta-23516 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.IO.FileSystem 4.0.1-beta-23516 provides a compile-time reference assembly for System.IO.FileSystem on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Globalization.Extensions 4.0.1-beta-23516 provides a compile-time reference assembly for System.Globalization.Extensions on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Linq.Expressions 4.0.11-beta-23516 provides a compile-time reference assembly for System.Linq.Expressions on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Security.Cryptography.X509Certificates 4.0.0-beta-23516 provides a compile-time reference assembly for System.Security.Cryptography.X509Certificates on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Security.Cryptography.Algorithms 4.0.0-beta-23516 provides a compile-time reference assembly for System.Security.Cryptography.Algorithms on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    System.Security.Cryptography.Encoding 4.0.0-beta-23516 provides a compile-time reference assembly for System.Security.Cryptography.Encoding on DNXCore,Version=v5.0, but there is no run-time assembly compatible with osx.10.11-x64.
    Some packages are not compatible with DNXCore,Version=v5.0 (osx.10.11-x64).

NuGet Config files used:
    /Users/Santhos/.nuget/NuGet/NuGet.Config

Feeds used:
    https://api.nuget.org/v3/index.json

1 个答案:

答案 0 :(得分:0)

实际问题是我安装了旧的asp 5和dotnet核心以及cli RC2,并且RC2版本也已经过时了。

解决方案: