我想在 Monotouch 上尝试一下 Jint,虽然 Jint-Mono 项目(不是 monotouch 版本,而是单声道)在我的 mac 上工作,但我无法让它在 iPhone 上工作。我刚刚创建了这个类:
namespace iPhoneTests
{
public class JintObject
{
public JintObject ()
{
var jintEngine = new JintEngine();
jintEngine.Run
(
@"Console.WriteLine('Hello World')"
);
}
}
}
每当我尝试调用 JintObject 方法时,我都会收到异常错误:
Unhandled Exception: System.TypeLoadException: A type load exception has occurred.
at Jint.Marshaller.WrapMethod (System.Reflection.MethodInfo info, Boolean passGlobal) [0x00000] in <filename unknown>:0
at Jint.Native.NativeMethod..ctor (System.Reflection.MethodInfo info, Jint.Native.JsObject prototype, IGlobal global) [0x00000] in <filename unknown>:0
at Jint.Native.NativeConstructor.ReflectOverload (ICollection`1 methods) [0x00000] in <filename unknown>:0
我究竟做错了什么?