service2 on linux for a Dotnet4 Service
Basically i have a dotnet 4 console application that i want to convert to a linux service. I have tested the console application on the latest build of mono and it works. I then converted the console application to a windows service and tried to use mono-service2 to start it but it resulted in some error about image not found. It seemed to be talking about the mono image or some such and not a image file if that makes sense. It seems that the mono-service2 is built for dotnet 2.0 not dotnet 4.0 and i can't seem to find code for a dotnet 4.0 version. Can anyone point me in the correct direction or give me another way to run my services? I really want them to show up as a service in webmin so i can stop, start and check their status over the web.
I can't post the exact error as i don't have it on me but i will post it in about 6 hours if it will help.
I know this is 2 years late but I had the same problem.
Further investigation showed that 'mono-service2' (on my ArchLinux pc) maps to /usr/lib/mono/2.0 where as 'mono-service' maps to /usr/lib/mono/4.5
I hope this saves other people time.
If the program simply needs to run in the background rather than on a console there are other ways of starting it on linux without using the services system from mono.
Eg via a shell script:
#!/bin/bash
mono myprogram.exe $@ 1> ~/stdout.log 2> ~/stderr.log &
链接地址: http://www.djcxy.com/p/90112.html