Click here to Skip to main content
12,697,536 members (28,293 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
public class SMSBL
    SMSDL dlayer = new SMSDL();
    SMSBO player = new SMSBO();

When the class gets loads, I'm getting an exception of stack overflow regarding declarations in the above class.
How to prevent stack overflow exception?
Posted 19-Dec-10 20:17pm
Updated 19-Dec-10 20:21pm
JF2015 20-Dec-10 1:24am
Edited to fix code formatting.
Abhinav S 20-Dec-10 1:29am
You need to provide more information to help someone figure out what the problem could be.
However, by the look of things there is something indide one of SMSDL or SMSBO classes that is causing some sort of an endless recursive code to run.
Sandeep Mewara 20-Dec-10 1:30am
1. You need to be clear on what Stack overflow error is
2. There must be more in your project leading to it(recurrsive instantiation) then just this class.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


It's better if you can share some more details about your class implementation.

At first glance it looks like the problem occurring because of never ending recursion. Check if you have classes which have dependencies on each other and they are initializing each other in their constructors.

Thanks and regards,
Chetan Ranpariya

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 20 Dec 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100