I think I may have found a solution for
First Chance Exception: RuntimeBinderException
Message: 'System.Dynamic.DynamicObject' does not contain a definition for 'moduleLoader'
http://www.codeproject.com/Articles/62839/Adventures-with-C-4-0-dynamic-ExpandoObject-Elasti
In my case the ModuleLoader was defined in a class library project that the main executable referenced, so I think this was the reason the exception was thrown.
Still not clear what the context variable is though!
First Chance Exception: RuntimeBinderException
Message: 'System.Dynamic.DynamicObject' does not contain a definition for 'moduleLoader'
http://www.codeproject.com/Articles/62839/Adventures-with-C-4-0-dynamic-ExpandoObject-Elasti
Type t = typeof (ModuleLoader); dynamic moduleLoaderDefinedInClassLib = Activator.CreateInstance(t, engine); engine.Script.moduleLoader = moduleLoaderDefinedInClassLib; string currentDir = FileOperations.GetCurrentlyExecutingAssemblyLocation(); engine.Execute(File.ReadAllText(currentDir + @"\Scripts\require.js")); engine.Execute(@"require.load = function (context, name, url) { moduleLoader.LoadModuleAsync(context, name, url); }");
Still not clear what the context variable is though!