Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
I have seen few services (i.e dcom server process launcher service ) where all the behaviours which willl allow us to start,stop,restart and startup type also. can u give me some suggestions to solve.  thanks in advance


What I have tried:

I can able to disable stop,start and restart option through service.But disable the startuptype is bit confusing.
Posted
Comments
NightWizzard 9-Feb-16 13:19pm    
Each windows service have to implement a standard interface with the default methods (Visual Studio provides a template - have a look there). If you don't want to provide a certain method, you can either remove it there or don't enter code to these procedures.
vigneshjayaraman 10-Feb-16 1:13am    
I dont find the method to grey out the startup type dropdown in the service panel.if u have clue just give me some code or link where i can refer to solve?
NightWizzard 10-Feb-16 2:04am    
There is no option to grey out the dropdown - you have to remove or disable each method separetely - look at the class that represents the service interface. The VS template provides empty procedures for each of the 4 methods.
vigneshjayaraman 10-Feb-16 2:35am    
Dear NightWizzard, Thanks for ur quick help.but still i didn't find the solution.I couldn't find the class tat represents service interface.

please help me step by step if you have time.

tel the class name and give the 4 methods having empty procedures tat u mentioned above.

thanks again
NightWizzard 10-Feb-16 13:53pm    
Please have a look here:
https://msdn.microsoft.com/de-de/library/9k985bc9%28v=vs.110%29.aspx
Actually you can turn on and off each method like (pause, continue, etc.) via class properties instead of removing the interfaces from code. All about creating services can be found at:
https://msdn.microsoft.com/de-de/library/zt39148a%28v=vs.110%29.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900