C# 如何为netcore50构建
我想构建一个控制台应用程序,它使用Microsoft.AspNet.signal.Client。 但是,对于netcoreapp1.1,该signer.Client似乎在nuget上不可用:C# 如何为netcore50构建,c#,.net-core,project.json,C#,.net Core,Project.json,我想构建一个控制台应用程序,它使用Microsoft.AspNet.signal.Client。 但是,对于netcoreapp1.1,该signer.Client似乎在nuget上不可用: Package Microsoft.AspNet.SignalR.Client 2.2.1 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.AspNet.SignalR.Client 2.2
Package Microsoft.AspNet.SignalR.Client 2.2.1 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.AspNet.SignalR.Client 2.2.1 supports:
- net40 (.NETFramework,Version=v4.0)
- net45 (.NETFramework,Version=v4.5)
- netcore50 (.NETCore,Version=v5.0)
- portable-net45+sl5+win8+wp8+wpa81(.NETPortable,Version=v0.0,Profile=Profile344)
- portable-win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile32)
One or more packages are incompatible with .NETCoreApp,Version=v1.1.
我想让我的应用程序尽可能开放/可移植(我不分发编译过的二进制文件,只分发供其他人使用的源代码)。
如何更改project.json以编译和运行应用程序(可能使用netcore50):
提前感谢。您可以在.net core app 1.1中使用netcore50,如下所示。更新的project.json-
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"Newtonsoft.Json": "*",
"Microsoft.AspNet.SignalR.Client": "2.2.1"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": "netcore50"
}
}
}
很有效,谢谢!现在我需要在某个地方阅读,netcore50和dnxcore50之间的区别是什么,以及这种更改的影响是什么。@wx78都是过时的名称。将来微软应该使用.NET标准名称。
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"Newtonsoft.Json": "*",
"Microsoft.AspNet.SignalR.Client": "2.2.1"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": "netcore50"
}
}
}