0

I have a .NET windows service project and a deployment project to create an MSI for the service. I've installed/uninstalled the service numerous times during development but seem to have broken something. The service appears to install and the program files exist as expected, the Windows add/remove program sees the new program but the Management Console (MMC) does not list the newly installed service.

How can I get MMC to recognize this service exists? It was working fine (appearing in MMC as expected) for a while. During one uninstall the software was removed but the service remained listed in MMC (obviously it wouldn't start). I managed to remove the orphaned service from MMC via Regedit but when I now reinstall the service MMC won't see it.

How can I get MMC to see this service when it is installed?

cymorg
  • 534
  • 2
  • 10
  • 27

1 Answers1

1

I know this sounds crazy but have you tried rebooting. I know services can be a pain sometimes to register/cleanup during development. I remember weird things can happen when you are testing the installer. Another old trick was to click the desktop and hit F5 which can force the registry to reload (or least it used to work sometimes many moons ago).

Are the registry keys back in the registry? If not then it's the installer. Check to make sure that the service installers (not the msi installer but the classes you added to the service) are executing correctly. You can try using InstallUtil.exe directly and if that works then the msi project isn't picking up the service installer classes in you main project. If not then it's possible the service installer classes aren't set up correctly. I'd create a dummy service project and compare the autogen code to what I have.

Are new versions of the files being copied to the correct places. It is also possible that the installer thinks the service is already up to date. That should have put up a dialog warning you though but you can check if all else fails. In that case you have to manually delete the files and reg keys again. If that doesn't work you can use procmon to see what the installer is doing in the registry and in the file system that makes it think the project is already installed.

csaam
  • 1,349
  • 9
  • 9
  • Helpful but not the solution I needed. I found the only way to fix this was to roll back my source code (losing a day's work!). The issue must have been in the source as the older version still works. As I only changed the main service code and not the installer/deployment it is very strange as, like you, I was sure the issue was with the installer. Anyway, thanks for the good advice. – cymorg Jan 15 '14 at 15:56
  • @cymorg No Problem glad your using source control. – csaam Jan 15 '14 at 19:06