windows service problem
- Hi i'm having problems debugging a windows service and i keep getting the same warning, i tried attaching it to a process and it didn't work:
Imports System.ServiceProcess
Public Class MotoStoreUpdate
Private update As UpdateBase = New UpdateBase()
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Shared Sub Main()
Dim ServicesToRun() As System.ServiceProcess.ServiceBase
ServicesToRun = New System.ServiceProcess.ServiceBase() {New MotoStoreUpdate()}
System.ServiceProcess.ServiceBase.Run(ServicesToRun) -> Here's where it stops
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
update.Start()
End Sub
Protected Overrides Sub OnStop()
update.Abort()
End Sub
Protected Overrides Sub OnShutdown()
update.Abort()
End Sub
End Class
this is the what i get:
Cannot start service from the command line or a debugger. A windows service must first be installed (using installutil.exe) and then started with the ServerExplorer, Services Admin Tool or the Net Start command
if you need something else let me know
All Replies
- have a look here please:
http://social.msdn.microsoft.com/Search/en-US?query=windows%20service%20problem&ac=8
Don't judge me, just Upgrade me. Thanks! - i already checked pretty much everything in there, specially Walkthrough: Creating a Windows Service Application in the Component Designer and it's all done and still doesn't work
- I found this online that might work:
http://www.worldofasp.net/tut/WindowsService/Creating_Windows_Services_in_NET_99.aspx
there's a section called Tips for Debugging Windows Services that i'm testing to see if it works- Unmarked As Answer bygusadolfo Tuesday, November 17, 2009 6:35 PM
- Marked As Answer byMartin Xie - MSFTMSFT, ModeratorFriday, November 13, 2009 3:19 AM
- That helped a little but i still get the same problem:
Shared Sub Main()
Dim sArgs As String()
sArgs = System.Environment.GetCommandLineArgs()
If sArgs.Length > 1 Then
If sArgs(1).ToLower() = "console" Then
Dim oService As New MotoStoreUpdate()
oService.OnStart(sArgs)
End If
End If
Dim ServicesToRun As System.ServiceProcess.ServiceBase()
ServicesToRun = New System.ServiceProcess.ServiceBase() {New MotoStoreUpdate()}
System.ServiceProcess.ServiceBase.Run(ServicesToRun)
End Sub
i still get:
Cannot start service from the command line or a debugger. A windows service must first be installed (using installutil.exe) and then started with the ServerExplorer, Services Admin Tool or the Net Start command


