Search code examples
c#visual-studio-2013windows-serviceswindows-installer

Windows Service Installer - Service name contains invalid characters, is empty, or is too long


I've been following this MSDN article about writing a Windows Service and accompanying installer. When I try to add the installer project and I right-click on the Design View and select 'Add Installer' I receive the following message:

Service name contains invalid characters, is empty, or is too long

My service name is set to "UploadManagerService". This doesn't contain any invalid characters that I'm aware of and is below the specified 80 character limit.

I've read several articles on here about this problem. This answer suggests that this is because the service name isn't set in Visual Studio though this is set in my case. I've also tried setting the service name in the app.config to see if that make any difference. Is there something else I could be missing or a way around this?


Solution

  • I would consider watching this:

    Create and Package a Windows Service using IsWiX

    You can really simplify the problem by eliminating the use of InstallUtil and using native MSI functionality. In fact, you'll notice that video only took 2 minutes and half that time is used to create the actual service.