简体   繁体   中英

Windows Service properties

How to change the the service name for my windows service in Visual Studio 2012. I'm just new to the windows service, and trying to figure out how to build it.

I've googled and read aa lot about Windows services and how to build them. Everywhere they mention:

In the Properties window for Service1.cs [Design] or Service1.vb [Design], set the ServiceName and the (Name) property for Service1 to MyNewService, if it's not already set.

But for me I can't seem to find where to change the servicename. I rightclicked on service1.cs and and went to properties. Here is a screenshot

在此处输入图片说明

It doesn't show me the ServiceName.

It depends on how you install the service. If you use sc.exe you will specify name as command parameter in installation. If you use install util, you can specify name in code.

Also look at this

You're looking at the properties of the CS file, not the service object itself. DOuble click it to open in the designer, then you will get actual properties of the service, including ServiceName

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