[Mono-bugs] [Bug 478105] New: Mono.CSharp.Evaluate() is unable to access any types in host program.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 20 09:54:57 EST 2009


           Summary: Mono.CSharp.Evaluate() is unable to access any types
                    in host program.
    Classification: Mono
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: lucas.meijer at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/525.19 (KHTML, like Gecko) Chrome/ Safari/525.19

Miguel asked me to file this as a bug:

using System.Reflection;

public class Test
    public static int jaja;

    static void Main()
        jaja = 4;

        Assembly a = Assembly.GetExecutingAssembly();

        // Mono.CSharp.Evaluator.LoadAssembly(a.Location);        // Also tried
this, didn't work
        var cm = Mono.CSharp.Evaluator.Compile("Test.jaja+3;");   // <--
throws. "the name Test does not exist in current context"
        object retvalue = null;
        cm.Invoke(ref retvalue);

Reproducible: Always

Steps to Reproduce:
compile program.

Actual Results:  
it throws with 'the name "Test" does not exist in current context'

Expected Results:  
no exception. it should return 7

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list