[Mono-dev] Mono.CSharp.Evaluator: x.GetType Bug?

lukebuehler lukas.buehler at gmail.com
Fri Jan 25 17:33:40 UTC 2013


This is regarding Mono 3.0.3: Mono.CSharp.Evaluator

When I instantiate an Evaluator and then then evaluate following input:

    var context = new CompilerContext(new CompilerSettings(), new
    var evaluator = new Evaluator(context);
    evaluator.DescribeTypeExpressions = true;

    object result = null;
    bool set = false;
    evaluator.Evaluate("class A{ public int X;}", out result, out set);

    //this works
    evaluator.Evaluate("var a = new A();a.GetType();", out result, out set);

    //this doesnt work
    evaluator.Evaluate("var a = new A();", out result, out set);
    //Error here:
    evaluator.Evaluate("a.GetType();", out result, out set);

I get an error in the second last line:
System.IO.FileNotFoundException: Could not load file or assembly 'eval-0,
Version=, Culture=neutral, PublicKeyToken=null' o
r one of its dependencies. The system cannot find the file specified.
File name: 'eval-0, Version=, Culture=neutral, PublicKeyToken=null'
   at <InteractiveExpressionClass>.Host(Object& $retval)
   at Mono.CSharp.Evaluator.Evaluate(String input, Object& result, Boolean&
   at MonoEval.Program.Main(String[] args) in
C:\Users\Luke\Dev\Samples\MonoEval\Program.cs:line 30

The last lines works if evaluate the code in the csharp interactive console
that comes with mono but NOT when I have my own instance of evaluator.

Any ideas why that might be? Is this a bug?


View this message in context: http://mono.1490590.n4.nabble.com/Mono-CSharp-Evaluator-x-GetType-Bug-tp4658288.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

More information about the Mono-devel-list mailing list