project.json是这样的(frameworks中用的是dnxcore50):
{ "dependencies": { "Kestrel": "1.0.0-beta4" }, "commands": { "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:8080" }, "frameworks": { //"dnx451": { }, "dnxcore50": { } } }
用 dnx . kestrel 命令运行时出现下面的错误:
System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1': AboutUs 1.0.0 Kestrel 1.0.0-beta4 Searched Locations: /git/cnblogs/{name}/project.json /usr/local/Cellar/mono/4.0.1/lib/mono/4.5/{name}.dll /usr/local/Cellar/mono/4.0.1/lib/mono/4.5/Facades/{name}.dll
如果frameworks启用dnx451(这时用的是mono),就能正常运行。
请问如何解决这个问题,让ASP.NET 5程序运行于.NET Core
需要用dnvm下载coreclr,操作命令:
dnvm upgrade -r coreclr
如果出现下面的错误:
Error: Could not find latest version from feed https://www.nuget.org/api/v2
可以改用下面的命令:
dnvm upgrade -u -r coreclr