简体   繁体   中英

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(); 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM