【问题标题】:Unable to load libuv in windows server 2012 r2?无法在 windows server 2012 r2 中加载 libuv?
【发布时间】:2015-10-15 05:51:07
【问题描述】:

在 Visual Studio 代码中,我在命令行面板中发出 dnx kestrel。 但是我遇到了这样的错误

info    : [Microsoft.Framework.DependencyInjection.DataProtectionServices] User
profile is available. Using 'C:\Users\myaccount\AppData\Local\ASP.NET\DataProt
ection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
System.InvalidOperationException: Unable to load libuv.
   at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Load(String dllToLoad)
   at Microsoft.AspNet.Server.Kestrel.KestrelEngine..ctor(ILibraryManager librar
yManager, IApplicationShutdown appShutdownService)
   at Microsoft.AspNet.Server.Kestrel.ServerFactory.Start(IServerInformation ser
verInformation, Func`2 application)
   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 serviceProvider)
   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 serviceProvider)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment
env, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, Framewo
rkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkNam
e targetFramework)
Press any key to continue . . .

我该如何解决这个问题? 谢谢。

【问题讨论】:

  • 为什么要在win2012 上使用红隼?你最好改用IISAspNet selfhostKestrel 应该用于 LinuxMac
  • libuvis part of node.jsdid you try to install node.js ?

标签: asp.net-core visual-studio-code


【解决方案1】:

Kestrel 使用 libuv 一个异步 I/O 库。因此,您可以安装它以使用 Kestrel 作为 Web 服务器,或者您可以使用 dnx web 来启动您的应用程序,其中 web 是 project.json 中的一个命令。

"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"}

【讨论】:

    【解决方案2】:

    为什么要在win2012上使用红隼?您最好改用 IIS 或 AspNet selfhost。 Kestrel 应该在 Linux 或 Mac 上使用

    哦,所以有一种叫做自托管的东西?感谢@agua from mars 提供的信息

    【讨论】:

    猜你喜欢
    • 2017-02-08
    • 1970-01-01
    • 1970-01-01
    • 2016-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多