473,387 Members | 1,398 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.

Stackoverflow exception in C# NT Service

I have started a nt service project in VS2003,
added a timer from the toolbox, and set the timer to
trigger every 20 secs. The method that the timer
calls has among others these lines:

ArrayList x = new ArrayList();
for (...) {
x.add(new someobject(...));
}

Once I add an object reference to the arraylist then
i get a stackoverflow exception. The object I add
is part of a datamodel, it only contains a few
properties, but no methods with any actual code.
The for-loop usually only runs one iteration.

Anyone know why this could be happening?
Nov 16 '05 #1
1 1890
TDOR <tj*****@hotmail.com> wrote:
I have started a nt service project in VS2003,
added a timer from the toolbox, and set the timer to
trigger every 20 secs. The method that the timer
calls has among others these lines:

ArrayList x = new ArrayList();
for (...) {
x.add(new someobject(...));
}

Once I add an object reference to the arraylist then
i get a stackoverflow exception. The object I add
is part of a datamodel, it only contains a few
properties, but no methods with any actual code.
The for-loop usually only runs one iteration.

Anyone know why this could be happening?


Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

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

Similar topics

6
by: Babu Mannaravalappil | last post by:
Can somebody please help me figure out why the following method exceptions out? Execution at the line marked with ********** hangs for about 15 seconds and then I get an error that says an...
7
by: Dan Bass | last post by:
In a somewhat complex application, I've developed plug-in architecture and am having a problem as to when to catch general exceptions for logging purposes. In each plug-in class library, for...
0
by: andrew lowe | last post by:
Can anyone comment on why in the following code i get a StackOverflowException on the marked line of code. The weird thing is i only get it when the string being returned in the second paramater...
6
by: sjoerd van den Nieuwenhof | last post by:
hello, i'm getting a error named: an unhandled exception of type 'system.stackoverflowException' occured in unknow module. whta does this mean?? please help me
23
by: Rob Meade | last post by:
Hi all, I think I may have created a bit of a problem earlier with some of my classes.... I *think* that I may have inherited a class that was inheriting that class - endless loop kinda...
9
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its...
2
by: wansch | last post by:
Hello, Iam quite new to programming and dont know enough about the stack. My problem is if I call a recurcive function like in the code TestCalc(100000), I get at some integer argument size a...
2
by: Richard Collette | last post by:
Hi, I have a service, that runs perfectly when executed outside of the web service environment. When called as a web service I get the exception listed below sporadically. A call to the web...
0
by: =?Utf-8?B?TVA=?= | last post by:
I hosted my WCF service in a Console App. the service is tagged to run as a singleton , The service implements following two methods One that throws exception public void ThrowException() {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.