Windows Service Project Not Starting On Different Machine

Hi guys,
I have a problem. I've got a service c sharp/.NET project on one computer. I can build the project and install the service using installutil and its all good. However, I really need that project on my other machine. I have exported the environment settings from the machine where it all works to to the new machine and copied the all files but the service does not start up. Keeps throwing me a 1067 error when i try to start it. i have tried this on a virtual  machine, on parallels and on bootcamp. All running windows 7 64bit.

If anyone could direct me to a solution that would be great thanks.
LVL 1
R0y4LAsked:
Who is Participating?
 
Rahul_GadeConnect With a Mentor Commented:
Comment this entire block and add another main function that will just give a call to the function in you code that actual start functional part of your code execution. So, this become a simple console app to help debugging.

0
 
Rahul_GadeCommented:

The error appears when your service gets crashed and some uncaught exceptions are thrown. This may happen even the appropriate .Net runtime is not available or user permission under whose profile the service is configured to run has insufficient rights.
In order to investigate further, run the service as a console application for which you just need to comment ServiceMain and add our normal main.
If this still crashes, you will get the appropriate reasoning in the console (i.e. Stack Trace).
If this doesn't crash, means you definitely have problems with user credentials.

-Rahul Gade
0
 
R0y4LAuthor Commented:
herryhelp - no there is no database connection. The only connection there is, is a USB connection to a barcode scanner device.

Rahul Gade - this is my main, what should I change?

namespace GuestinationService
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] 
			{ 
				new GuestinationVenderService() 
			};
            ServiceBase.Run(ServicesToRun);
        }
    }
}

Open in new window


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.