473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem With Starting Windows 2000 Service Developed in VB.Net

I'm having a strange problem with a service I developed. After installing the service on the target machine, I'm trying to start it using the Services admin window. I get the "Windows is starting" status window, but it times out - even though the application's log file says that it did start. The service's OnStart event spawns a thread and exits - that's all! I even tried it with no code in the OnStart event and get the same thing. The service is actually executing and doing everything I expect it to, but its status stays at Starting.

The other weird thing is that it doesn't happen on all machines. We have multiple development machines, and it works fine when I install it on them, but it doesn't work on my development machine or the production machine.

Has anyone run across this???

Thanks!
Nov 20 '05 #1
4 1384
"hogcods" <an*******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
I'm having a strange problem with a service I developed. After installing the service on the target machine, I'm trying to start it using the Services
admin window. I get the "Windows is starting" status window, but it times
out - even though the application's log file says that it did start. The
service's OnStart event spawns a thread and exits - that's all! I even tried
it with no code in the OnStart event and get the same thing. The service is
actually executing and doing everything I expect it to, but its status stays
at Starting.
The other weird thing is that it doesn't happen on all machines. We have multiple development machines, and it works fine when I install it on them,
but it doesn't work on my development machine or the production machine.
Has anyone run across this???

I have done some work with services, but I have not seen this. What happens
if you compile it as a standard Executable? Will it run on all machines? Is
there anything in common on the machines that will run it vs. the machines
that won't run it?

Have you tried creating an entirly new service, with a different name and no
code? In other words, will any .NET services run?

~
Jeremy

Nov 20 '05 #2
Post the Service Class code I've had this happen to me before, it not always
an easy thing to find.
"hogcods" <an*******@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
I'm having a strange problem with a service I developed. After installing the service on the target machine, I'm trying to start it using the Services
admin window. I get the "Windows is starting" status window, but it times
out - even though the application's log file says that it did start. The
service's OnStart event spawns a thread and exits - that's all! I even tried
it with no code in the OnStart event and get the same thing. The service is
actually executing and doing everything I expect it to, but its status stays
at Starting.
The other weird thing is that it doesn't happen on all machines. We have multiple development machines, and it works fine when I install it on them,
but it doesn't work on my development machine or the production machine.
Has anyone run across this???

Thanks!

Nov 20 '05 #3
Yes, I created a new service class and didn't add any code - same thing.

----- Jeremy Cowles wrote: -----

I have done some work with services, but I have not seen this. What happens
if you compile it as a standard Executable? Will it run on all machines? Is
there anything in common on the machines that will run it vs. the machines
that won't run it?

Have you tried creating an entirly new service, with a different name and no
code? In other words, will any .NET services run?

~
Jeremy
Nov 20 '05 #4
Here's the service class code for the test service I set up that has no additional code

Imports System.ServiceProces

Public Class Service
Inherits System.ServiceProcess.ServiceBas

#Region " Component Designer generated code

Public Sub New(
MyBase.New(

' This call is required by the Component Designer
InitializeComponent(

' Add any initialization after the InitializeComponent() cal

End Su

'UserService overrides dispose to clean up the component list
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean
If disposing The
If Not (components Is Nothing) The
components.Dispose(
End I
End I
MyBase.Dispose(disposing
End Su

' The main entry point for the proces
<MTAThread()>
Shared Sub Main(
Dim ServicesToRun() As System.ServiceProcess.ServiceBas

' More than one NT Service may run within the same process. To ad
' another service to this process, change the following line t
' create a second service object. For example

' ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1, New MySecondUserService

ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1

System.ServiceProcess.ServiceBase.Run(ServicesToRu n
End Su

'Required by the Component Designe
Private components As System.ComponentModel.IContaine

' NOTE: The following procedure is required by the Component Designe
' It can be modified using the Component Designer.
' Do not modify it using the code editor
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent(
components = New System.ComponentModel.Container(
Me.ServiceName = "Service1
End Su

#End Regio

Protected Overrides Sub OnStart(ByVal args() As String
' Add code here to start your service. This method should set thing
' in motion so your service can do its work
End Su

Protected Overrides Sub OnStop(
' Add code here to perform any tear-down necessary to stop your service
End Su

End Clas

And here's the Project Installer code

Imports System.ComponentMode
Imports System.Configuration.Instal

<RunInstaller(True)> Public Class ProjectInstalle
Inherits System.Configuration.Install.Installe

#Region " Component Designer generated code

Public Sub New(
MyBase.New(

'This call is required by the Component Designer
InitializeComponent(

'Add any initialization after the InitializeComponent() cal

End Su

'Installer overrides dispose to clean up the component list
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean
If disposing The
If Not (components Is Nothing) The
components.Dispose(
End I
End I
MyBase.Dispose(disposing
End Su

'Required by the Component Designe
Private components As System.ComponentModel.IContaine

'NOTE: The following procedure is required by the Component Designe
'It can be modified using the Component Designer.
'Do not modify it using the code editor
Friend WithEvents ServiceProcessInstaller1 As System.ServiceProcess.ServiceProcessInstalle
Friend WithEvents ServiceInstaller1 As System.ServiceProcess.ServiceInstalle
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent(
Me.ServiceProcessInstaller1 = New System.ServiceProcess.ServiceProcessInstaller(
Me.ServiceInstaller1 = New System.ServiceProcess.ServiceInstaller(

'ServiceProcessInstaller

Me.ServiceProcessInstaller1.Password = Nothin
Me.ServiceProcessInstaller1.Username = Nothin

'ServiceInstaller

Me.ServiceInstaller1.ServiceName = "TestService

'ProjectInstalle

Me.Installers.AddRange(New System.Configuration.Install.Installer() {Me.ServiceProcessInstaller1, Me.ServiceInstaller1}

End Sub

#End Region

End Class

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave | last post by:
I have developed a VB.net application that transfers a SOAP wrapped message to another server securely(using SSL and sever/client certificates). When I run this app from a Windows 2000...
5
by: CG | last post by:
Hi I have developed a Windows Service When I try to start the Service it tells me that it cannot start as there may not be any work to do When I comment out below line of code in my OnStart...
0
by: Martijn Remmen | last post by:
I have developed a service which exposes a COM object. This service is running perfect on Windows 2000 Server and Windows 2000 Professional under the SYSTEM account. When the service is...
1
by: Glenn | last post by:
I have used this code successfully in a form application. I tried to add the same code in a service and have not been able to get the application to start. I have the service starting with a local...
2
by: DaveF | last post by:
I am trying to write a service to fire an ftp object off. I want to wait 2 minutes and then download the files. Then repeat every 2 minutes. The files just seem to stop downloading. Does that timer...
17
by: Danieltbt05 | last post by:
just installed SQL server 2000 and using my client , i can't locate the server. I used SQL query analyzer to search but no servers were found. Error message is as below Server : Msg17,level...
2
by: Tom | last post by:
Hi, We have a web service (developed in C# framework 1) that run for some time on Windows 2000. Recently we upgraded it to framework 2 and run successfully on Windows 2000 and XP. However, we...
1
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and...
0
by: =?Utf-8?B?U2ltb25EZXY=?= | last post by:
Hi All I would like to install the same Windows Service project on the same server under different names, one for each customer. I have been able to do it but I would like an expert opinion as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.