https://bugzilla.novell.com/show_bug.cgi?id=478105


           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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.48 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
        Mono.CSharp.Evaluator.ReferenceAssembly(a);
        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.
run.



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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to