.net – DNX(rc1)web命令不起作用

我在运行MVC6应用程序时遇到了麻烦.

项目构建良好,没有错误,包正确加载(没有错误到期恢复)

Here is my global.json code. As you see, both dnx versions in app and on machine are the same

当然,我正在使用VS2015与WebTools-beta8和DotNetVersionManager-beta8.

这是我的project.json的一部分:

"commands": {
  "web": "Microsoft.AspNet.Server.Kestrel",
  "gen": "Microsoft.Extensions.CodeGeneration"
},

"frameworks": {
    "dnx451": { }
},

"exclude": [
    "wwwroot",
    "node_modules",
    "bower_components",
    "Content"
],
"publishExclude": [
    "Content",
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
],
"scripts": {
    "postrestore": [ "npm install", "bower install" ],
    "prepare": [ "gulp copy" ]
}

当我点击’Web’命令,项目构建,但然后cmd窗口显示下一条消息:(‘Could not load file or assembly Microsoft.Extensions.PlatformAbstract’)

输出/调试窗口以.结尾
“程序'[14200] dnx.exe’退出了代码1(0x1).”

我已经更新了dnvm和webTools,但问题没有解决.顺便说一句,在另一台PC上,项目运行良好,所以问题可能与我的dnx有关.

最佳答案 您是否尝试过从命令提示符恢复依赖项?

为此,只需从命令提示符运行’dnu restore’即可.确保命令提示工作目录位于MVC项目中.

点赞