【问题标题】:Could not load assembly error when running dnx web运行 dnx web 时无法加载程序集错误
【发布时间】:2015-10-05 14:17:50
【问题描述】:

我使用 Yeoman asp.net 生成器中的模板创建了一个 asp.net Web API 项目。 我可以使用 dnu build 命令成功构建它,但是当我运行 dnx web 时,它给了我这个错误:

  System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Overlapped, Version=4.0.1.0, Culture=neut
ral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not ma
tch the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'System.Threading.Overlapped, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.Net.Http.Server.WebListener.CloseRequestQueueHandle()
   at Microsoft.Net.Http.Server.WebListener.Start()
   at Microsoft.AspNet.Server.WebListener.MessagePump.Start(Func`2 app)
   at Microsoft.AspNet.Server.WebListener.ServerFactory.Start(IServerInformation server, Func`2 app)
   at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start()
   at Microsoft.AspNet.Hosting.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider service
Provider)
   at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
   at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider service
Provider)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targe
tFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)

我在 windows 7 x64 上使用 coreclr 1.0.0-rc1-15798 coreclr x64。 我可以从 https://github.com/aspnet/home

运行模板

project.json 文件:

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-beta7",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta7",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta7"
  },

  "commands": {
    "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --config hosting.ini",
    "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --config hosting.ini"
  },

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

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ]
}

【问题讨论】:

  • 不要混用 beta7 和 rc

标签: c# asp.net dnx coreclr


【解决方案1】:

使用 dnx beta7。不要将 beta7 与 beta8 或 rc1 位混合

【讨论】:

    猜你喜欢
    • 2016-02-04
    • 2011-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-26
    • 2011-06-03
    • 1970-01-01
    相关资源
    最近更新 更多