DotNet CLI - 无法恢复包
DotNet CLI - unable to restore packages
我有一个使用 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
实际问题是我安装了旧的 asp 5、dotnet core 和 cli RC2,并且 RC2 版本也已过时。
解决方案:
- 卸载旧版本asp 5/core
- 安装新的 RC2 不是来自网络 http://dotnet.github.io/getting-started/ 因为那里的包已经完全过时了
- 在此处安装来自 github 的最新 RC2:https://github.com/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
实际问题是我安装了旧的 asp 5、dotnet core 和 cli RC2,并且 RC2 版本也已过时。
解决方案:
- 卸载旧版本asp 5/core
- 安装新的 RC2 不是来自网络 http://dotnet.github.io/getting-started/ 因为那里的包已经完全过时了
- 在此处安装来自 github 的最新 RC2:https://github.com/dotnet/cli