1

I am attempting to work on a Service in Mono-Develop. When working on services in Visual Studio I do some wrapping (as per a different SE article) to allow me to easily debug:

        ServiceBase[] ServicesToRun;
        ServicesToRun = new ServiceBase[] 
            { 
                new UtilService() 
            };
        if (Environment.UserInteractive)
        {
            RunInteractive(ServicesToRun);
        }
        else
        {
            ServiceBase.Run(ServicesToRun);
        };

Unfortunatley, when I run that code in MonoDevelop it determines that Environment.UserInteractive is false and attempts to run it as a service.

How do I set Environment.UserInteractive?

Jefferey Cave
  • 2,507
  • 1
  • 27
  • 46
  • 1
    On Mono Environment.UserInteractive always returns false. This question seems to be similar to another StackOverflow question which has a workaround - http://stackoverflow.com/questions/9065065/how-to-detect-if-im-running-in-mono-service. – Matt Ward Jun 18 '15 at 12:54
  • That looks *very* similar, probably identical. – Jefferey Cave Jun 18 '15 at 16:15

0 Answers0