尝试执行时dnx网络错误500 [英] dnx web error 500 when try to execute

查看:108
本文介绍了尝试执行时dnx网络错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Mac(ElCapitán)中执行,这是官方存储库.

I'm trying to execute in a Mac (El Capitán), the MusicStore example in ASP.NET from the official repository.

我已经使用mono和core测试了它,并在dnvm中进行了切换,但是没有结果. dnu构建与mono配合正常,使用core,则构建失败.

I have tested it using mono and core, switching in dnvm, but no results. The dnu build is working fine with mono, with core, the build fails.

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

When I execute dnx web, all works fine, but when I execute the project (firs load), I have a 500 error, with this error:

发生未处理的异常:无法解析服务 键入"Microsoft.Extensions.CompilationAbstractions.ILibraryExporter" 尝试激活时 "Microsoft.AspNet.Mvc.Razor.Compilation.RoslynCompilationService".

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),但我不知道问题出在哪里...而且我已阅读

I have changed all possibilities (Mono and Core), but I have no idea where is the problem... and I have read this question with no results

已添加项目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列表(命令结果)我已经使用Mono和Core测试过...

推荐答案

注意:确保获取音乐商店的rc1版本

在一切正常后,使应用程序正常运行的主要过程是确保您的运行时位于最新版本的Feed(在本例中为Nuget.org)上.

The main process to making the application work once everything is working is to make sure that your runtime is on the latest version of the feed (in this case, Nuget.org).

当前的Nuget.org位于rc1-final.因此,您需要rc1-final/rc1-update1才能正确运行它. (哪个对你没事)

Nuget.org at the moment is at rc1-final. So you'll need the rc1-final/rc1-update1 to run it properly. (Which is ok for you)

完成此操作后,我们就可以为该应用程序还原软件包了.

Once this is done, we're ready to restore packages for the application.

  • dnu restore用于DNX运行时
  • dnu restore for the DNX runtime

在其他情况下(在这种情况下不是MusicStore),您需要运行npm installbower install.

And in other scenarios (not the MusicStore in this case), you'll need to run npm install and bower install.

一旦所有内容都进行了更新,则可以在与project.json相同的级别上运行dnx web,它应该可以运行.

Once everything is updated, you can run dnx web at the same level as the project.json and it should run.

这篇关于尝试执行时dnx网络错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆