Asp.net core NancyFx与.Net内核的不兼容性
我曾试图让NancyFx在Ubuntu和Windows下运行.Net Core,但我得到的信息是NancyFx it与.NetCoreApp不兼容。 我对整个.Net核心都是新手,所以欢迎任何帮助 myproject.jsonAsp.net core NancyFx与.Net内核的不兼容性,asp.net-core,.net-core,nancy,Asp.net Core,.net Core,Nancy,我曾试图让NancyFx在Ubuntu和Windows下运行.Net Core,但我得到的信息是NancyFx it与.NetCoreApp不兼容。 我对整个.Net核心都是新手,所以欢迎任何帮助 myproject.json { "version": "1.0.0-*", "buildOptions": { "emitEntryPoint": true }, "dependencies": { "Microsoft.NETCore.App": "1
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.1",
"Nancy": "2.0.0-barneyrubble"
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}
dotnet还原上的错误消息
Errors in D:\User\Documents\Visual Studio 2015\Projects\WebService\src\WebService\project.json
Package Nancy 2.0.0-barneyrubble is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Nancy 2.0.
0-barneyrubble supports:
- net452 (.NETFramework,Version=v4.5.2)
- netstandard1.6 (.NETStandard,Version=v1.6)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
有一些教程向人们展示了如何在.Net Core上使用Nancy,那么我做错了什么吗?我找到了答案。问题是Microsoft.NETCore.App依赖项中缺少类型
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Nancy": "2.0.0-barneyrubble"
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}
在Windows和Linux上完美构建。您是否有可能运行
dotnet--version
来确定您使用的是哪个CLI版本?您使用的是net standard 1.0。您应该使用1.6Update更新到最新的.net CLI(1.0.0-preview2-003131),它可以工作。@Pinpoint我已经添加了dotnet版本。这是目前(2016年9月27日)最新的版本。@secana您能检查一下您的项目中没有未指定其他SDK版本的global.json
文件吗?
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Nancy": "2.0.0-barneyrubble"
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}