At work we are currently developing a Windows Service, I noticed that when you install the service using the InstallUtil it doesn’t set a service description for you.
To add one add the following code to your ProjectInstaller class (this is created by clicking “Add Installer” in your windows service design view) just under the InitializeComponent method:
Public Overrides Sub Install(ByVal stateServer As IDictionary)
MyBase.Install(stateServer)
Me.AddServiceDescription()
End Sub
Public Sub AddServiceDescription()
Dim service As RegistryKey = Registry.LocalMachine.OpenSubKey("System").OpenSubKey("CurrentControlSet").OpenSubKey("Services").OpenSubKey(Me.ServiceInstaller1.ServiceName, True)
service.SetValue("Description", "My service description.")
This block of code will go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\YourWindowsService and create a service description key for you based on your service name.
Theme design by Jelle Druyts
Pick a theme: BlogXP business calmBlue Candid Blue dasBlog dasblogger DirectionalRedux Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream Portal Project84 Project84Grass Slate Sound Waves Tricoleur useit.com Voidclass2 BlogXP business calmBlue Candid Blue dasBlog dasblogger DirectionalRedux Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream Portal Project84 Project84Grass Slate Sound Waves Tricoleur useit.com Voidclass2
Powered by: newtelligence dasBlog 2.0.7226.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Steven Rockarts
E-mail