This project has moved and is read-only. For the latest updates, please go here.

ScopeCompile error Cannot Resolve Symbol

Jun 16, 2016 at 11:00 AM
        private void button1_Click(object sender, EventArgs e)
            dynamic scope = new ExpandoObject();
            scope.a = 3; scope.b = 5;
            var exp = new CompiledExpression() { StringToParse = "a + b" };
            var func = exp.ScopeCompile();
            var result = func(scope);
what is wrong with the code above? it give me error "Cannot resolve symbol "a" at line 1 char 0"

I follow the documentation in ScopeCompile, what I wish to do is able to change my scope variable on runtime without recompiling
Sep 16, 2016 at 12:46 AM
Unfortunately dynamic scopes aren't well supported in 2.x. You could create a concrete class with the variables a and b and it should work.