2

Possible Duplicate:
C# eval equivalent?

Some languages like Perl or JavaScript have cool (although not fast) eval function for running code from string.

Does .NET has some king of that functionality for C# ?

Is there anything that offers interface like this:

    var e = new Evaluator("C#");
    e.Eval("int a=3; Console.Writeline(\"{0}\", a); return 123;");
    int x = (int)e.Result;

?

4
  • 1
    Have a look at the Roslyn Project too Commented Dec 9, 2011 at 17:39
  • 2
    Next to the answers you'll get you might have a look at the beta version of Roslyn: msdn.microsoft.com/en-us/roslyn Commented Dec 9, 2011 at 17:39
  • 1
    Look at Flee - codeproject.com/KB/recipes/Flee.aspx Commented Dec 9, 2011 at 17:42
  • 1
    This question should be reopened, as the duplicate question is 3 years old and new technology Roslyn exists already as answer to this question. Commented Dec 9, 2011 at 19:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.