How to detect if I'm running in mono-service?
How can I detect I'm running under mono-service2? (in C#/.NET 3.5, running mono 2.6.7 on ubuntu 11) Type.GetType("Mono.Runtime") tells me I'm running in mono, so that part is ok. But Environment.UserInteractive is always false under mono it seems, so I'm struggling to figure out if I'm actually running under mono-service2 - with no console/terminal. Environment.UserInteractive is the proper solution but, unfortunately, it is currently not implemented in Mono. I may take a look on it someday and upgrade this answer ;) However just to detect you can probably use hacky solution around this one: