Topshelf and .net core under linux

半城伤御伤魂 提交于 2019-12-24 20:15:03

问题


I have a simple application that starts service using topshelf and it looks simple:

 HostFactory.Run(x =>
 {
    x.Service<RequestService>();
    x.RunAsLocalSystem();
 });

Well it works, but under windows when i tried this under linux I am getting:

Topshelf.Runtime.Windows.WindowsHostEnvironment Error: 0 : Unable to get parent process (ignored), System.DllNotFoundException: Unable to load shared library 'kernel32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libkernel32.dll: cannot open shared object file: No such file or directory

Did someone came across this problem? I tried to google it but someone said it works other that it is tool only for windows.

Or maybe there is some other service hoisting framework for .net core?


回答1:


Assuming that you installed this version of Topshelf - you would notice under dependencies that it doesn't support .NET Core and therefore it will not run under a Linux environment.

It will only run under a Windows environment as you mentioned in your post. kernel32.dll is a Windows dependency that it cannot find, therefore it cannot run.



来源:https://stackoverflow.com/questions/56752046/topshelf-and-net-core-under-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!