473,791 Members | 2,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1905
TDOR <tj*****@hotmai l.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.co m>
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
2505
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 Unhandled StackOverFlowException occurred. The execution does not even get passed to the catch block. At the time of my test, only one of 12 tables in the dataset (catalogsDS) really has changes. The dataset is not a huge one. Most tables have less...
7
1798
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 example, I'm assuming it's throw on errors, and that the core then catches them. I've got proxy classes handling some fiddly details of the plug-ins. Should I allow the exception to bubble to the top most point it can in a call stack, then catch...
0
1985
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 approaches 600+kb ? BSTR service; BSTR xml; CoInitialize(NULL); _esyv0111Ptr broker; HRESULT hr = broker.CreateInstance(__uuidof(esyv0111));
6
3569
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
2571
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 scenario....although this wasn't built out of no where VS pops this error up - whats more frustrating is that it does it now every time i open the project in VS, its gives me an option to debug - yes, to debug the deveng!!!! I'm not quite that...
9
6653
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 length is 642 bytes ( I have appended it to the end of this message). I suspect that the reason may have something to do with an incorrect declaration of which class to de-serialize to. In the attached code I substituted @@@@@@@ in the code below with...
2
1716
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 stack overflow exception. The recursion is not endless. But at 1000000 the exception is thrown. What is limitation of the stack or how can I figure it out. Are there restrictions about function calls?
2
4957
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 method may succeed one time and not another. I cannot find any reason why it would work one time and not another. The exception occurs every two or three calls to the web method. The service utilizes a COM component provided by PeopleSoft...
0
2666
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() { throw new Exception("Exception thrown"); }
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.