[英]Add installer says Service name contains invalid characters, is empty, or is too long
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();
EmailService是一个部分类,构造函数调用InitializeComponent();
in the designer, which sets the servicename. 在设计师,设置servicename。
I am guessing I've done something silly regarding my base class that's breaking it or confusing it. 我猜我已经为我的基类做了一些愚蠢的事情,它正在破坏它或使它混淆。 Any ideas? 有任何想法吗?
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. 在设计视图中右键单击您的服务,单击“ Properties
并确保已设置ServiceName
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.