Operation is not valid due to the current state of the object?
- by Bill
I am programming in C#; the code was working about a week ago, however it throws an exception and I don't understand at all what could be wrong with it.
Var root = new CalculationNode(); -> Throw exception.
In the call stack thats the only thing listed, I've been told that it could be that I need a clean build, but I am open to any ideas or suggestions.
Thanks,
-Bill
Update:
Exception's Detail
System.InvalidOperationException was unhandled by user code
  Message=Operation is not valid due to the current state of the object.
  Source=Calculator.Logic
  StackTrace:
       at ~.Calculator.Logic.MyBaseExpressionParser.Parse(String expression) in ~\Source\Calculator.Logic\MyBaseExpressionParser.cs:line 44
       at ~.Calculator.Logic.Tests.MyBaseCalculatorServiceTests.BasicMathDivision() in ~\Projects\Tests\Calculator.Logic.Tests\MyBaseCalculatorServiceTests.cs:line 60
  InnerException: 
CalculationNode's code:
public sealed calss CalculationNode
{
 public CalculationNode()
{
this.Left = null;
this.Right = null;
this.Element = new CalculationElement();
}
public CalculationNode Left {get;set;}
public CalculationNode Right {get;set;}
public CalculationElement Element {get; set;}
}
CalculationElement's code:
public sealed class CalculationElement
{
 public CalculationElement()
{
Value = string.Empty;
IsOperator = false;
}
public string Value {get; set}
public bool IsOperator {get; set}
}