Closed stone89son closed 1 year ago
Hi @stone89son,
You can't load .NET assemblies via import
or require
, but ExtendedHostFunctions.lib
provides something similar:
engine.AddHostObject("host", new ExtendedHostFunctions());
engine.AddHostType(typeof(Console));
engine.Execute(@"
const clr = host.lib('mscorlib', 'System', 'System.Core');
let array = clr.System.Linq.Enumerable.Range(0, 5).ToArray();
Console.WriteLine(Array.from(array).toString()); // output: 0,1,2,3,4
");
Good luck!
Please reopen this issue if you have additional thoughts or questions about this topic. Thank you!
hi everyone. If user can import C# assembly (dll,exe) from javascript code same node module, I think very useful. in the case, Is there a way to that?