An unhandled exception of type 'System.StackOverflowException' occurred in loadversionresult.dll

public abstract class result: calculate
    {
public Vesion ResultVesion
        {
            get
            {                
                return this.ResultVesion ;
            }
            set
            {                
                this.ResultVesion  = value;            
}

public abstract class Valuation
    {

private Vesion resultVesion;

public Vesion ResultVesion
        {
            get { return resultVesion ; }
            set { resultVesion  = value; }
        }

}


An unhandled exception of type 'System.StackOverflowException' occurred in loadversionresult.dll

this exception i am getting at get-->in class result-->at property ResultVesion.

Could you please say me how to overcome this error.
kravindraAsked:
Who is Participating?
 
Carl TawnSystems and Integration DeveloperCommented:
Well the problem is that the ResultVesion property of your "result" class is returning itself which is causing an infinite loop. I can't really tell from the code you have posted what exactly it should return.
0
 
shadow77Commented:
I agree with Carl.  Perhaps your result class should be defined this way (ie, add resultVesion as a private member and access it through ResultVesion).
public abstract class result: calculate
{

    private Vesion resultVesion;

    public Vesion ResultVesion 
    {
        get { return resultVesion ; }
        set { resultVesion  = value; }
    }
}

Open in new window

0
 
shadow77Commented:
It appears that the people who responded answered the question.
0
 
shadow77Commented:
I think that carl_tawn posted a useful answer (http:#31882828) to the question and that he deserves to receive points.
0
 
Carl TawnSystems and Integration DeveloperCommented:
Thanks shadow77. Although I'd recommend a split between (http:#31882828) and (http:#31887449) since I pointed out the problem, but shadow77 provided a sample fix.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.