Hi, I am trying to use mono-service2 to run a Windows Service Project from visual studio. I run this on debian with mono 2.0 and compile with.
gmcs *.cs -pkg:dotnet
I'm trying to start with this (I tried with -d to install to the directory with the application and -n, -m set)
mono-service2 -l:service.lock --debug Program.exe
The only code change is to add scripts for testing.
Service1.cs
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...."); } } }
This error occurs as a result.
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Mono.Unix.Native.Syscall ---> 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]
thanks for the help
Answer
I missed the env variable LD____LIBRARY____PATH, so I added it to csh for the test
#!/bin/csh setenv LD_LIBRARY_PATH .:/usr/local/lib mono-service2 -l:service.lock --debug Program.exe
linux mono mono-service
Scott Cowan Dec 09 '08 at 6:39 2008-12-09 06:39
source share