Running Jurassic on WP7?

Sep 1, 2011 at 9:11 PM

Tried it, but it always breaks and the error message shows nothing really :(

Do you have an idea what could be wrong? I did try the Silverlight Jurassic dll. (and the other one, but don't work) http://msdn.microsoft.com/en-us/library/ff426930%28v=VS.95%29.aspx

 

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in Microsoft.Phone.dll

Coordinator
Sep 4, 2011 at 10:50 PM

Jurassic won't run on the current version of WP7 because it lacks the Reflection.Emit APIs that Jurassic requires.  However, I believe Reflection.Emit has been added in Mango.  Which version of WP7 did you try it on?

Sep 5, 2011 at 12:33 AM

I've tried it on Mango and it seems like Mango only provides a small portion of the Reflection.Emit namespace and not all of the features used in Jurassic are present.

Coordinator
Sep 6, 2011 at 12:25 AM
Edited Sep 6, 2011 at 12:25 AM

From reading the docs, at least DynamicMethod, ILGenerator and OpCodes are fully supported.  This means it should be feasible to get Jurassic working on WP7.1 (with some changes), though without any debugging support.

Sep 6, 2011 at 9:53 PM

Paul,

Thanks for the response. Your thoughts were correct, it was pretty trivial to get Jurassic working on Mango (w/o debugging). I'm still testing it (see my thread on SetGlobalFunction and Silverlight, as it applies on WP, too), but it looks promising.

Thanks,

Zack

Coordinator
Sep 6, 2011 at 11:33 PM

Good news, thanks for investigating :-)

Sep 9, 2011 at 8:53 AM

Hi Zack/Paul

I'm just starting to look at WP7 Mango and would love to try to get this working too (I can try to help!).

To avoid duplication of effort, is there a working project/solution file I can use at all? If there is, I'd be very grateful if you could email it to me - me[at]slodge[dot]com

Stuart

Sep 9, 2011 at 9:44 AM

Things I'm already playing with....

- #ifdef'ing out the debug half of GenerateCode() inside MethodGenerator.cs

- Adding a HashSet - similar to: http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/e1dd3571-dfb8-4abe-b63a-62106d6a4965/ - but adding a IEqualityComparer<T> constructor

Sep 10, 2011 at 5:19 AM
Edited Sep 10, 2011 at 5:19 AM

paul - is there anyway I can submit changes back to the project for WP7/Mango?

Basically there's:

- a class library project file for WinPho7

- a sample project (example app)

- a HashSet<T> class for WinPho7

- a couple of "#if WINDOWS_PHONE" statements to add to MethodGenerator.cs and to ScriptEngine.cs - just avoiding ReflectionEmitModuleInfo

There's no test project yet...

Coordinator
Sep 10, 2011 at 11:56 AM

Stuart: submit a pull request or just email me a zip file at paulbartrum[at]hotmail.com