473,396 Members | 1,797 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,396 software developers and data experts.

Problems Starting a VB windows Service

Hi All,

I created a Windows Service in Visual Basic.NET and am having troubles. My Service installs fine, but when I start I get two exceptions thrown in the Event Log and the service stops. Here they are:

1: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at ServiceName.OnStart(String[] args)

This one happens before the service starts, then I get

2. Service cannot be started. System.InvalidCastException: Specified cast is not valid.
at ServiceName.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object state)

Any ideas, I'm beating my head against the wall.

Thanks in advance,

--------------------------------
From: Shane Lowenberger

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>hmUaBxmY40eKXUYtKEQH4A==</Id>
Nov 20 '05 #1
1 1615
Dear Shane
regarding the first problem I believe this is not related to the fact that
this is a service.
this seems like trying to access an array outside it's boundaries.
Example
dim arr(30)
arr(40) = 3
this would give the same error.
Regards
Sameh
"Shane Lowenberger via .NET 247" <an*******@dotnet247.com> wrote in message
news:OK**************@TK2MSFTNGP10.phx.gbl...
Hi All,

I created a Windows Service in Visual Basic.NET and am having troubles. My Service installs fine, but when I start I get two exceptions thrown in
the Event Log and the service stops. Here they are:
1: System.IndexOutOfRangeException: Index was outside the bounds of the array. at ServiceName.OnStart(String[] args)

This one happens before the service starts, then I get

2. Service cannot be started. System.InvalidCastException: Specified cast is not valid. at ServiceName.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object state)
Any ideas, I'm beating my head against the wall.

Thanks in advance,

--------------------------------
From: Shane Lowenberger

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>hmUaBxmY40eKXUYtKEQH4A==</Id>

Nov 20 '05 #2

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

Similar topics

0
by: ccuthbert | last post by:
I have a MCMS 2002 site that we recently had several hotfixes installed. After installing the hotfixes, both AOL users and Earthlink users experience tha same problem, namely that intermittently...
0
by: Rafal Zurkowski | last post by:
Hello everybody, Maybe my question is very simple but I can't find answer for it. And without it I can't go on. I have installed SQL 2000 Personal edition on Windows 98. All the setup process ran...
2
by: Cantankerous Old Git | last post by:
I am trying to write a program that I hope to get working as a command-line app to start with, and then eventually use a windows service wrapper to call it as a service. Its purpose is to attach...
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: Razzie | last post by:
Hey all, I wrote a Windows Service. When I test it on my developement machine (winXP) it works fine. It starts ok, never crashes, etc. When I install the service on another machine (win2000) it...
5
by: Van Nguyen via DotNetMonster.com | last post by:
My app run at 2 modes: Windows and Service. At Windows mode, my app works fine but at service mode, I can not use CreateDirectory command to create a new directory on server. Ex:...
0
by: tshad | last post by:
I have a Windows Service I created that just sets a timer and writes to EventLog every 10 seconds. It installed fine and it actually starts. But it says it doesn't. The progress bar shows the...
7
by: | last post by:
Hi to everyone! I have an Apache Webserver running on Win2000. I try to start a console application an the server though PHP, with the functions exec() or passthru() but it doesn't work. The...
5
by: eliasen | last post by:
Hi I have created a Windows Service using C# and .NET2.0. The service is quite simple - right now it doesn't do anything except throwing an exception in the OnStart method. It used to something...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.