【问题标题】:dnx kestrel "System.EntryPointNotFoundException: uv_loop_size"dnx 红隼“System.EntryPointNotFoundException:uv_loop_size”
【发布时间】:2016-02-24 03:53:40
【问题描述】:

我正在尝试运行由 yo aspnet 创建的未经修改的 Web Api 应用程序。

我收到此错误:

System.EntryPointNotFoundException: uv_loop_size
  at (wrapper managed-to-native) Microsoft.AspNet.Server.Kestrel.Networking.Libuv+NativeDarwinMonoMethods:uv_loop_size ()
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.loop_size () <0x42615b8 + 0x00014> in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNet.Server.Kestrel.Networking.Libuv uv) <0x4261528 + 0x0002b> in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) <0x4261160 + 0x0005f> in <filename unknown>:0 

有什么想法吗?

dnvm 列表输出:

Active Version              Runtime Architecture OperatingSystem Alias
------ -------              ------- ------------ --------------- -----
       1.0.0-rc1-final      coreclr x64          darwin          
       1.0.0-rc1-final      mono                 linux/osx       
  *    1.0.0-rc2-16177      mono                 linux/osx       default

单声道版

Mono JIT compiler version 4.2.1 (explicit/6dd2d0d Tue Nov 10 18:01:18 EST 2015)

更新

我跑了

 export DYLD_FALLBACK_LIBRARY_PATH=/Users/Andy/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-rc1-final/runtimes/osx/native/

在运行 dnx web 时最终给了我一个不同的错误:

System.DllNotFoundException: libc.dylib
  at (wrapper managed-to-native) System.IO.KeventWatcher:kqueue ()
  at System.IO.KeventWatcher.GetInstance (IFileWatcher& watcher) <0x105a29310 + 0x000f3> in <filename unknown>:0 
  at System.IO.FileSystemWatcher.InitWatcher () <0x105a28fa0 + 0x0012c> in <filename unknown>:0 
  at System.IO.FileSystemWatcher..ctor (System.String path, System.String filter) <0x105a28d00 + 0x00114> in <filename unknown>:0 
  at System.IO.FileSystemWatcher..ctor (System.String path) <0x105a28cc0 + 0x00023> in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileSystemWatcher:.ctor (string)
  at Microsoft.AspNet.FileProviders.PhysicalFilesWatcher..ctor (System.String root) <0x105a285b0 + 0x00154> in <filename unknown>:0 
  at Microsoft.AspNet.FileProviders.PhysicalFileProvider..ctor (System.String root) <0x105a282d0 + 0x000e4> in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.HostingEnvironmentExtensions.Initialize (IHostingEnvironment hostingEnvironment, System.String applicationBasePath, IConfiguration config) <0x105a27f20 + 0x001ea> in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.WebHostBuilder.Build () <0x105a1a860 + 0x000b8> in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.WebApplication.Run (System.Type startupType, System.String[] args) <0x105560990 + 0x00216> in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.WebApplication.Run (System.String[] args) <0x10555fef0 + 0x0001a> in <filename unknown>:0 
  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) <0x10555fec0 + 0x00014> in <filename unknown>:0 
  at Microsoft.AspNet.Server.Kestrel.Program.Main (System.String[] args) <0x10555fc90 + 0x000b5> in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x1050027a0 + 0x000b7> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () in <filename unknown>:line 0
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) in <filename unknown>:line 0
   at Microsoft.Dnx.ApplicationHost.Program+<>c__DisplayClass3_0.<ExecuteMain>b__0 () in <filename unknown>:line 0
   at System.Threading.Tasks.Task`1[TResult].InnerInvoke () in <filename unknown>:line 0
   at System.Threading.Tasks.Task.Execute () in <filename unknown>:line 0

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
   at System.IO.FileSystemWatcher.Stop () in <filename unknown>:line 0
   at System.IO.FileSystemWatcher.Finalize () in <filename unknown>:line 0

【问题讨论】:

  • 关于您的更新:libc.dylib 位于/usr/lib,不确定您是否设置了现有的“DYLD_FALLBACK_LIBRARY_PATH”,'export DYLD_FALLBACK_LIBRARY_PATH=/libuv/dir/location:/usr/lib: $DYLD_FALLBACK_LIBRARY_PATH' 这样您就不会重置现有的 DYLD_FALLBACK_LIBRARY_PATH 环境变量...
  • 我和安迪的情况完全相同(包括更新的问题)。我尝试了你的建议@RobertN 将 /usr/lib 添加到 env var,我又回到了原来的“uv_loop_size”错误。值得注意的是,我在 beta8 中没有这个问题。我现在只有更新到 rc1-final。
  • @KevinCraft,在下面的答案线程中签出 Pawel 的评论线程,因为 RC 版本中的本地库加载发生了变化@blog.3d-logic.com/2015/11/10/…

标签: asp.net .net mono dnx libuv


【解决方案1】:

仅供参考:这与 mono 无关

它没有通过System.Net.Libuv 程序集找到libuv 本机库:

https://github.com/dotnet/corefxlab/blob/d76ebe8ab5ed058d3d6903939ab0e4ee4e19b773/src/System.Net.Libuv/src/System/Net/Libuv/Interop.cs

1st) 运行 dnvm list -detailed 以确定您正在使用的 dnx 运行时的位置,即

Active Version              Runtime Architecture OperatingSystem Alias   Location
------ -------              ------- ------------ --------------- -----   --------
       1.0.0-beta8          mono                 linux/osx               ~/.dnx/runtimes
       1.0.0-rc1-final      mono                 linux/osx               ~/.dnx/runtimes
  *    1.0.0-rc2-16177      mono                 linux/osx       default ~/.dnx/runtimes

2nd) 我的dnx 安装是$HOME/.dnx/runtime(默认),所以我可以运行find ~/.dnx/packages -name "libuv*"

/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-beta8/runtimes/osx/native/libuv.dylib
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-beta8/runtimes/win10-arm/native/libuv.dll
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-beta8/runtimes/win7-x64/native/libuv.dll
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-beta8/runtimes/win7-x86/native/libuv.dll
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-rc1-final/runtimes/osx/native/libuv.dylib
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-rc1-final/runtimes/win10-arm/native/libuv.dll
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-rc1-final/runtimes/win7-x64/native/libuv.dll
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-rc1-final/runtimes/win7-x86/native/libuv.dll

找到libuv.dylib 在系统中的位置后,您可以设置环境。 var DYLD_FALLBACK_LIBRARY_PATH 到那个目录:

export DYLD_FALLBACK_LIBRARY_PATH=/your/libuv/directory/location:$DYLD_FALLBACK_LIBRARY_PATH

再次运行你的 dmvm cmd:

dnvm exec 1.0.0-rc2-16177 dnx web

注意:

在 OS-X 上 libuv 也可以通过 brew @ stable version 1.7.5 获得,但我没有尝试过,因为 MS 没有对其 libuv.dylib 版本进行版本控制,所以我不确定它是否是 @987654322 @ ...(?)

otool -L /Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-rc1-final/runtimes/osx/native/libuv.dylib
/Users/sushi/.dnx/packages/Microsoft.AspNet.Server.Kestrel/1.0.0-rc1-final/runtimes/osx/native/libuv.dylib:
    /Users/asplab/Documents/buildAgent/temp/buildTmp/fs-poll-5b0daf.out (compatibility version 0.0.0, current version 0.0.0)

【讨论】:

  • 谢谢,这是很好的信息。今天晚些时候我会做一些挖掘工作。
  • 你确定不是 DYLD_FALLBACK_LIBRARY_PATH 而不是 DYLIB_FALLBACK_LIBRARY_PATH 吗?
  • @RobertN - 您可以在此处找到 Kestrel 随附的版本:github.com/aspnet/libuv-build/tree/dev/submodules。目前它是 1.7.3 版本,提交后可以在 Windows 上运行多个循环(我们团队对 libuv 的贡献)
  • @AndyD,你是对的,适合我手写输入而不是剪切/粘贴 ;-) 我更正了答案,谢谢
  • @Pawel,太棒了,感谢您提供的信息,没想到要查看子模块...如果版本信息被存根为“当前版本 0.0.0”,我仍然会喜欢它" 告诉我我必须希望我有一个合适的 ;-)
【解决方案2】:

在多次重新安装 Mono、Visual Code、Xamarin Studio、DNX、libuv,升级 Node 和 RoberN 给我一些明确的指示后,我想我应该检查我的 PATH 环境变量。 果然,只要我将 /usr/lib/:/usr/local/lib 添加到我的 PATH 中,它就开始工作了!

dnx 网络

Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

成功了!

【讨论】:

  • 有趣...` /usr/lib/:/usr/local/lib to my PATH` 如果可行,那么 MS 正在做一些非常非标准的 dyld 路径探测,因为你不应该这样做在您的“执行”路径中包含 lib 目录...
  • 再说一次,如果可行的话,那实际上应该报告为非 Windows 平台上的错误
  • 我不太熟悉我的路径应该是什么,或者什么不是,但是是的,它有效。知道如何在运行 dnx web 时记录文件访问以查看它在 Windows 上的实际外观 ala procmon 吗?
【解决方案3】:

万一有人来这里寻找其他解决方案......

我尝试了以上所有方法,包括多次重新安装所有内容和 PATH 更新但均未成功,最后按照解决方案 here 切换到 CoreCLR,它终于奏效了!

dnvm install 1.0.0-rc1-update1 -r coreclr -arch x64

dnvm use 1.0.0-rc1-update1 -r coreclr -arch x64

dnvm list

然后,转到您的项目并再试一次

dnx web

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-11
    • 2020-03-31
    • 2010-11-29
    • 1970-01-01
    • 2012-09-18
    • 2015-02-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多