【问题标题】:Project does not contain any commands in project.json and cannot be started directlyproject.json中不包含任何命令,无法直接启动
【发布时间】:2016-03-04 14:39:03
【问题描述】:

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

我的 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 列表:

【问题讨论】:

    标签: visual-studio-2015 dnx coreclr


    【解决方案1】:

    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 是项目文件中的命令之一

    【讨论】:

      猜你喜欢
      • 2020-09-06
      • 1970-01-01
      • 1970-01-01
      • 2016-10-10
      • 2018-04-03
      • 1970-01-01
      • 1970-01-01
      • 2017-09-26
      • 1970-01-01
      相关资源
      最近更新 更多