incomplete
incomplete

Reputation: 546

Windows service only running on the machine it generated

I have built setup file for my windows service in visual studio 2010.Its working fine on my machine. but when im installing it to another machine it executed but nothing happens. I cant figure out whats happening.

static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static void Main()
    {
        ServiceBase[] ServicesToRun;
#if (!DEBUG)


        ServicesToRun = new ServiceBase[] 
        {
            new EmailService()

        };
        EmailService listener = new EmailService();
        listener.temp();

        ServiceBase.Run(ServicesToRun);
 #else

    EmailService listener = new EmailService();
        listener.WorkerThreadFunc();
        listener.ServiceEmailMethod();

 #endif

     }
 }

Upvotes: 0

Views: 125

Answers (1)

Fredrik M&#246;rk
Fredrik M&#246;rk

Reputation: 158349

It looks as if your service will start only if it's a release build. Could it be that you run the release build on your machine, but the debug build on the other machine?

Upvotes: 1

Related Questions