This project has moved. For the latest updates, please go here.

Cannot call CLR methods in WP71

Apr 11, 2012 at 11:20 PM

I'm using the latest code (from Friday). Whenever I try to access a method or retrieve a property value of a "normal" CLR object, Jurassic.Compiler.Binder.Call()'s binderDelegate invocation throws an InvalidProgramException. I assume that WP7 doesn't like some of the generated IL from CreateDelegate(), but I don't really know CIL, so I can't debug it myself. Any ideas on this?

Thanks!

Coordinator
Apr 12, 2012 at 6:27 AM

There are quite a few known issues with the WP7 implementation - it's not stable yet.  It should mostly work though - can you post sample code?

Apr 12, 2012 at 2:23 PM

namespace JurassicTest
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
            Loaded += MainPage_Loaded;
        }

        public void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            var engine = new ScriptEngine {EnableExposedClrTypes = true};
            engine.SetGlobalValue("Cow", new TheCow());
            var res = engine.Evaluate("Cow.Speak();");
        }
    }

    public class TheCow
    {
        public string Speak()
        {
            return "moo";
        }
    }
}

Please let me know if/how I can help with improving WP7 support, as I'm looking at using Jurassic in my LiveLibs project.