无法加载文件或程序集 'Microsoft.Framework.Logging.ILoggerFactory' 或其依赖项之一

Could not load file or assembly 'Microsoft.Framework.Logging.ILoggerFactory' or one of its dependencies

在我的新 asp.net 5 应用程序中,出现以下错误:

Could not load file or assembly 'Microsoft.Framework.Logging.ILoggerFactory' or one of its dependencies. The system cannot find the file specified

System.IO.FileNotFoundException Could not load file or assembly 'Microsoft.Framework.Logging.ILoggerFactory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

但是我已经在 project.json

上添加了参考
{
  /* Click to learn more about project.json  http://go.microsoft.com/fwlink/?LinkID=517074 */
  "webroot": "wwwroot",
  "version": "1.0.0-*",
  "dependencies": {
       "EntityFramework.SqlServer": "7.0.0-beta4",
        "EntityFramework.Commands": "7.0.0-beta4",
        "Microsoft.AspNet.Mvc": "6.0.0-beta4",
        "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta4",
        "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta4",
        "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta4",
        "Microsoft.AspNet.Authentication.Google": "1.0.0-beta4",
        "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta4",
        "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta4",
        "Microsoft.AspNet.Diagnostics": "1.0.0-beta4",
        "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta4",
        "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta4",
        "Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
        "Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
        "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta4",
        "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
        "Microsoft.Framework.ConfigurationModel.UserSecrets": "1.0.0-beta4",
        "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta4",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta4",
        "Microsoft.AspNet.Security.OpenIdConnect": "1.0.0-beta3",
       "Microsoft.Owin.Security.Cookies": "3.0.1",
      "Microsoft.Framework.Logging.Console": "1.0.0-beta4" 
  },
  "commands": {
    /* Change the port number when you are self hosting this application */
    "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
    "gen": "Microsoft.Framework.CodeGeneration",
    "ef": "EntityFramework.Commands"
  },
  "frameworks": {
    "dnx451": { }
  },
  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "bundleExclude": [
    "node_modules",
    "bower_components",
    "**.kproj",
    "**.user",
    "**.vspscc"
  ],
  "scripts": {
    "postrestore": [ "npm install" ],
    "prepare": [ "grunt bower:install" ]
  }
}

我错过了什么?

奇怪的是它构建!

您应该更新到最新版本(撰写本文时为 Beta 7,尽管 Beta 8 将于下周发布)。 Beta 4 现在有几个版本已经过时并且非常不稳定。

根据@Geerten 的建议,您还需要添加 Microsoft.Framework.Logging。您可以从官方 announcement 了解有关升级到 Beta 7 的更多信息。请注意,Beta 7 也有新版本的工具,因此您需要安装它。