dnx 红隼 "System.EntryPointNotFoundException: uv_loop_size"

dnx kestrel "System.EntryPointNotFoundException: uv_loop_size"

我正在尝试 运行 由 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/

当 运行ning 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

仅供参考:这与 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 再次运行:

dnvm exec 1.0.0-rc2-16177 dnx web

注:

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

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)

在多次重新安装 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.

成功!

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

我尝试了以上所有方法,包括多次 re-installs 所有内容和 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