尝试执行时 dnx web 错误 500

dnx web error 500 when try to execute

我正在尝试在 Mac (El Capitán) 中执行 official repository.

中 ASP.NET 中的 MusicStore 示例

我用mono和core测试过,在dnvm中切换,但没有结果。 dnu 构建在 mono 和 core 上运行良好,构建失败。

当我执行 dnx web 时,一切正常,但是当我执行项目(第一次加载)时,出现 500 错误,错误如下:

An unhandled exception has occurred: Unable to resolve service for type 'Microsoft.Extensions.CompilationAbstractions.ILibraryExporter' while attempting to activate 'Microsoft.AspNet.Mvc.Razor.Compilation.RoslynCompilationService'.

我已经更改了所有可能性(Mono 和 Core),但我不知道问题出在哪里...而且我已经阅读 this question 没有结果

项目 JSON 添加

{
"authors": [
    "Microsoft"
],
"description": "Music store application on ASP.NET 5",
"version": "1.0.0-*",
"compilationOptions": { "warningsAsErrors": true, "define": [ "DEMO", "TESTING" ] },
"compile": [
    "../../shared/**/*.cs"
],
"publishExclude": "*.cmd",
"webroot": "wwwroot",
"dependencies": {
    "EntityFramework.InMemory": "7.0.0-*",
    "EntityFramework.MicrosoftSqlServer": "7.0.0-*",
    "Microsoft.AspNet.Antiforgery": "1.0.0-*",
    "Microsoft.AspNet.Authentication.Cookies": "1.0.0-*",
    "Microsoft.AspNet.Authentication.Facebook": "1.0.0-*",
    "Microsoft.AspNet.Authentication.Google": "1.0.0-*",
    "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-*",
    "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-*",
    "Microsoft.AspNet.Authentication.Twitter": "1.0.0-*",
    "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-*",
    "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-*",
    "Microsoft.AspNet.Mvc": "6.0.0-*",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*",
    "Microsoft.AspNet.Server.IIS": "1.0.0-*",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-*",
    "Microsoft.AspNet.Session": "1.0.0-*",
    "Microsoft.AspNet.StaticFiles": "1.0.0-*",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-*",
    "Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-*",
    "Microsoft.Extensions.Configuration.CommandLine": "1.0.0-*",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-*",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-*",
    "Microsoft.Extensions.Logging.Console": "1.0.0-*"
},
"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"
},
"frameworks": {
    "dnx451": { },
    "dnxcore50": {
        "dependencies": {
            "System.Runtime.Serialization.Primitives": "4.0.10-*"
        }
    }
}

}

谢谢!!

dnvm list(命令结果)我用 Mono 和 Core 测试过...

注意:确保获得 rc1 version of the Music Store

一旦一切正常,使应用程序正常工作的主要过程是确保您的 运行时间在最新版本的提要上(在本例中,Nuget.org)。

Nuget.org 目前在 rc1-final。所以你需要 rc1-final/rc1-update1 到 运行 正确。 (这对你来说没问题)

一旦完成,我们就可以恢复应用程序的包了。

  • dnu restore DNX 运行时间

而在其他情况下(在本例中不是 MusicStore),您将需要 运行 npm installbower install

一旦更新了所有内容,您可以 运行 dnx webproject.json 处于同一级别,它应该 运行.