Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 739833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:26:45+00:00 2026-05-14T08:26:45+00:00

I am working on porting a VB6 application to C# (Winforms 3.5) and while

  • 0

I am working on porting a VB6 application to C# (Winforms 3.5) and while doing so I’m trying to break up the functionality into various classes (ie database class, data validation class, string manipulation class).

Right now when I attempt to run the program in Debug mode the program pauses and then crashes with a StackOverFlowException. VS 2008 suggests a infinite recursion cause.

I have been trying to trace what might be causing this recursion and right now my only hypothesis is that class initializations (which I do in the header(?) of each class).

My thought is this:

  • mainForm initializes classA
  • classA initializes classB
  • classB initializes classA
  • ….

Does this make sense or should I be looking elsewhere?

UPDATE1 (a code sample):

mainForm

namespace john
{
    public partial class frmLogin : Form
    {
    stringCustom sc = new sc();

stringCustom

namespace john
{
   class stringCustom
   {
       retrieveValues rv = new retrieveValues();

retrieveValues

namespace john
{
    class retrieveValues
    {
    stringCustom sc = new stringCustom();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:26:46+00:00Added an answer on May 14, 2026 at 8:26 am

    9 times out of 10, infinite recursion bugs are caused by bad property accessors:

    public class BrokenClass
    {
        private string name;
    
        public string Name
        {
            get { return name; }
            set { Name = value; }  // <--- Whoops
        }
    }
    

    I’ve also had it happen when doing major refactorings with method overloads; sometimes you accidentally end up with a method calling itself when it’s supposed to call a different overloaded method.

    Either way, you should be able to tell by looking at the call stack for the exception and checking for a repeating pattern. If you see one, then your problem is somewhere in that loop.

    Edit – well, based on your example code, you definitely have infinite recursion in the initializers. I have no idea what that code is supposed to be doing, but it’s never going to terminate. StringCustom immediately creates RetrieveValues which immediately creates another StringCustom, and so on.

    This is one reason why circular class dependencies are typically considered a code smell. Whenever you see ClassA depending on ClassB and ClassB depending on ClassA then you should try to refactor; the exception is if ClassB is entirely owned and managed by ClassA (i.e. an inner class), which is clearly not the case here. You need to eliminate one of the dependencies somehow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 537k
  • Answers 537k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There's no automatic way to do this through a view… May 17, 2026 at 1:42 am
  • Editorial Team
    Editorial Team added an answer Are you running the application server as a service? Drive… May 17, 2026 at 1:42 am
  • Editorial Team
    Editorial Team added an answer I guess the short answer would be NO, from my… May 17, 2026 at 1:42 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm working on porting a large vb6 application to .NET. The current app is
We are currently working on porting an old VB6 application to WPF. The plan,
I'm working on porting some classic VB6 code to C# and just stumbled across
I'm working on porting a Visual C++ application to GCC (should build on MingW
I am working on porting an existing VB.Net application to Java, and could not
I'm working on a VB6 app that will do some very simple communication with
Im working on porting some old ALP user accounts to a new ASP.Net solution,
I'm working on porting my open source particle engine test from SDL to SDL
Right now I am porting a VB6 project over to C# and keep getting
I'm working on a drupal site where I allow users to login while at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.