private static void Transform(JintPluginsStore plugins) { var engine = new Engine(); engine.UsePlugins("ais", plugins); engine.Execute(@" function hello() { return ais.TestPlugin.Test('dsadsa'); }; "); try { var hello = engine.Invoke("hello"); Console.WriteLine(hello); } catch (TargetInvocationException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); } }