20 May 2009

Windows Services in C# (.NET Framework 3.5)

Okay... maybe I'm just completely mis-remembering, but IIRC, when authoring a Windows Service in C# 2.0, there was a nifty 'Installer' class you could just add to your project that would be nicely configured for you. You'd have to set the service name and a few other things, but, other than that, you could just build your application and install via MSI or (as I normally did) through InstallUtil.exe. I guess the guys in Redmond decided we were too lazy, though, because I and two of my buddies at work (both rather more experienced than I) spent most of yesterday and a fair deal of time today figuring out why we couldn't get a @#*&%# service to install. We kept getting a strange error message: "No Public Installer with RunInstallerAttribute.Yes was found." We [SEARCHENGINE]-ed the message and we kept getting posts talking about setting up the installer class, but that wasn't good enough for us. "Who wants to know how to do that by hand" we said. Apparently, anyone using Visual Studio 2008. For the life of us, we couldn't find the prebuilt installer. So, because I'll forget if I don't have it listed somewhere... You must create your own Installer Class (which must inherit from Installer) to install a Windows Service created in VS2008. If anyone knows of an automated way to do this, I'd appreciate the comments...

No comments:

Post a Comment