Project不包含project.json中的任何命令,也无法直接启动

时间:2016-03-04 14:39:04

标签: visual-studio-2015 dnx coreclr

我在Visual Studio 2015中启动项目时遇到了错误。 image

我的project.json文件:

{
   "version": "1.0.0-*",
   "description": "xxxxEngine Class Library",
   "authors": [ "somebody" ],
   "tags": [ "" ],
   "projectUrl": "",
   "licenseUrl": "",
   "frameworks": {
   "dnx451": {
      "Microsoft.CSharp": "4.0.1-beta-23516",
      "System.Collections": "4.0.11-beta-23516",
      "System.Linq": "4.0.1-beta-23516",
      "System.Runtime": "4.0.21-beta-23516",
      "System.Threading": "4.0.11-beta-23516"
    }
  },
  "dependencies": {
    "Stateless": "2.5.53",
    "xxx.yyy": "1.0.0-*"
  }
}

这是我的DNVM列表:

DNVM

1 个答案:

答案 0 :(得分:0)

project.json文件中至少需要一个命令,类似于文件here中的命令:

"commands": {
  "gen": "Microsoft.Extensions.CodeGeneration",
  "run": "run server.urls=http://localhost:5003",
  "web": "Microsoft.AspNet.Server.Kestrel",
  "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5004",
  "weblistener": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5002"
}

那是因为你运行dnx <command>其中command是项目文件中的一个命令