Note that there are some explanatory texts on larger screens.

plurals
  1. POusing mono-service to wrap a windows service on linux
    text
    copied!<p>Hi I'm trying to use mono-service2 to run a stock Windows Service Project from visual studio. I'm running this on debian with mono 2.0 and compiling with.</p> <pre><code>gmcs *.cs -pkg:dotnet </code></pre> <p>I try and start with this (I've tried with -d set to the dir with the app and -n,-m set)</p> <pre><code>mono-service2 -l:service.lock --debug Program.exe </code></pre> <p>The only code change is to add writelines for testing</p> <p><strong>Service1.cs</strong></p> <pre><code>using System; using System.ServiceProcess; namespace spikes { public partial class Service1 : ServiceBase { public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { Console.WriteLine("starting..."); } protected override void OnStop() { Console.WriteLine("stopping...."); } } } </code></pre> <p>The resulting is this error</p> <pre><code>Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Mono.Unix.Native.Syscall ---&gt; System.DllNotFoundException: libMonoPosixHelper.so at (wrapper managed-to-native) Mono.Unix.Native.Syscall:_L_ctermid () at Mono.Unix.Native.Syscall..cctor () [0x00000] --- End of inner exception stack trace --- at MonoServiceRunner.Main (System.String[] args) [0x00000] </code></pre> <p>Thanks for your help</p> <p><strong>Answer</strong></p> <p>I was missing the LD____LIBRARY____PATH env variable, so I added it in a csh for a test</p> <pre><code>#!/bin/csh setenv LD_LIBRARY_PATH .:/usr/local/lib mono-service2 -l:service.lock --debug Program.exe </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload