添加安装程序说服务名称包含无效字符、为空或太长 [英] Add installer says Service name contains invalid characters, is empty, or is too long

查看:52
本文介绍了添加安装程序说服务名称包含无效字符、为空或太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个服务,当我右键单击并按创建安装程序时,我收到上述错误消息.

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.

基本上是这样的:

EmailService : MyService

MyService : ServiceBase

EmailService 是一个分部类,构造函数调用了设计器中的 InitializeComponent();,它设置了 servicename.

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?

推荐答案

名称是否仅以编程方式设置?这是系统无法识别的.在设计视图中右键单击您的服务,单击 Properties 并确保设置了 ServiceName.

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.

这篇关于添加安装程序说服务名称包含无效字符、为空或太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆