This weeks embarrasing moment
We all have those, I'm sure of it. Today it was my time to walk away from my computer and hide my face. So what happenend?
I built a windows service for my current assigment. I tested it and it worked so it was time to deploy it to the test server. The solution included a setup project, so I simply compiled the setup and sent it off. To my surprise, I was called to tell me the setup didn't work properly. According to the tester, the files had been installed, but the service did not show in the services window.
I couldn't believe it, so I ran the setup again on my system and checked my services window. Weird, it's there. I uninstalled it and checked it again. It was still there! WTF?!?!?! Time to open the good old dos-prompt and run InstallUtil /u on the service application in my debug folder. And yes, the service was gone. I proceeded in running the setup again, and it didn't appear in my services window.
I then checked the installer class in my service project and found that my installer class was tagged with the [RunInstaller(true)] attribute. I then checked a service class that I knew was installing properly and that class turned out to be tagged with [RunInstallerAttribute(true)]. You'll notice the small but significant difference. And the reason for my shame. Still trying to figure out why the [RunInstaller(true)] didn't raise a compiler error, though.
Lessons learned
- Be humble, you can't even trust your own work. Or the compiler...
- Make sure the service is uninstalled and doesn't show in the services window before testing the setup.
- Run the setup to make sure it installs all necessary files.
- Check if the service shows up in the services window.