【问题标题】:DNX (rc1) web command does not workingDNX (rc1) web 命令不起作用
【发布时间】:2015-11-11 14:11:11
【问题描述】:

我在运行 MVC6 应用程序时遇到问题。 项目构建良好,没有错误,包正确加载(恢复没有错误)

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

当然,我正在使用带有 WebTools-beta8 和 DotNetVersionManager-beta8 的 VS2015。

这是我的 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 的问题。

【问题讨论】:

  • 难道你没有机会使用 beta8 运行时运行带有 rc1 包的项目吗?
  • 你确定你在“依赖”部分有所有需要的包吗?请出示。
  • 在 net451 框架上引用项目时,我有同样的行为。
  • 尝试从%UserProfile/.dnx/packages删除所有下载的nuget包,然后再次执行dnu restore

标签: .net asp.net-core dnx


【解决方案1】:

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

为此,只需从命令提示符运行“dnu restore”。确保命令提示符工作目录位于您的 MVC 项目中。

【讨论】:

  • 嗨,我将我的项目复制到 C 中的另一个位置:.. 然后我使用 powershell 运行 dnu restore。尝试再次启动应用程序,但我仍然收到相同的错误
  • 嗨 Luis,抱歉回复晚了。你的错误是什么?您能否向我们展示您的 dnvm 列表结果、dnx --version 结果、您的 global.json 和 project.json(仅显示依赖项和框架的部分)?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-30
  • 2016-01-01
相关资源
最近更新 更多