Exception: Error 1083: The executable program that this service is configured to run in does not implement the service.

In short: verify that the service name is correct.  Totally correct.

Longer:

Debugging windows services written in dotnet can be hard.  They have no GUI and have to be installed by a semi secret process.  Then they have to be started by a system call.  And if the start fails it is not necessarily possible to uninstall the service without rebooting.  The CL.exe doesn’t work and hacking the registry doesn’t work.

Today I spent hours tracking down a bug that surfaced with a “Error 1083: The executable program that this service is configured to run in does not implement the service.” when starting the service.  In the end I found out that the ServiceName was incorrect.

To be honest I got some clues, in one place it said MyMailer instead of MyMailerService.  I couldn’t be sure if this was correct or not since I had inherited the project and my search turned out nothing so I dropped it.

By (almost) chance I checked into the automagically created MyMail.designer.cs file and noticed this.ServiceName=”MyMailer”.  Which, it turned out, was the culprit.

I learned a trick on the way.  The service has 30 (I believe) seconds to start.  If it doesn’t fulfill it is shot down by Windows.  When I started the process it failed and I got a question whether I wanted to debug it.  Unfortunately it takes more thatn 30 s to open my VS2010.  So I started VS as administrator (necessary in Win7) and loaded the project.  When I then started the service I got the question whether to attach and I did.  Two seconds of work and I got a highlighted row at the exact point.

Tags: , , ,

5 Responses to “Exception: Error 1083: The executable program that this service is configured to run in does not implement the service.”

  1. Derek Williams says:

    Thank you.

    Fixed my problem

  2. Adam says:

    You are indeed correct about this and thanks! but what does it check the service name against to deem it incorrect?

  3. admin says:

    The service has two strings where one is name and one is a describing string; plus the name of the exe. I guess ServiceName is the important one and the others are… not as important.

  4. gaston says:

    Excelent !! This work for me !!

  5. Bandi says:

    Thank you very much. It works for me.

Leave a Reply