Add installer says Service name contains invalid characters, is empty, or is too long

时光总嘲笑我的痴心妄想 提交于 2019-12-21 07:06:24

问题


I've created a service, when I right click and press create installer, I get the above error message.

The service name is not missing and is valid.

The problem is probably in that I have a base class on my service, with a couple of properties and an empty constructor.

Basically looks like this:

EmailService : MyService

MyService : ServiceBase

The EmailService is a partial class, and the constructor calls InitializeComponent(); in the designer, which sets the servicename.

I am guessing I've done something silly regarding my base class that's breaking it or confusing it. Any ideas?


回答1:


Is the name set programmatically only? This is not recognized by the system. Right-click your service in design view, click Properties and make sure ServiceName is set.



来源:https://stackoverflow.com/questions/22641171/add-installer-says-service-name-contains-invalid-characters-is-empty-or-is-too

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!