public EvaluatorEngine() : base(null) { vars = new Dictionary <string, object>(); this.typeReflector = TypeReflector.GetTypeReflectorFor(Globals.TypeRefs.ToReferenceContext(this.GetType())); engine = new Microsoft.JScript.Vsa.VsaEngine(); engine.doFast = false; output = new StringBuilder(); StringWriter sw = new StringWriter(output); engine.InitVsaEngine("executerjscript.net", new VsaSite(sw)); imports = new List <string>(); List <string> asses = new List <string>(); foreach (Assembly assem in AppDomain.CurrentDomain.GetAssemblies()) { try { VsaReference reference = new VsaReference(engine, Path.GetFileNameWithoutExtension(assem.Location)); engine.Items.CreateItem(reference.AssemblyName, Microsoft.Vsa.VsaItemType.Reference, Microsoft.Vsa.VsaItemFlag.None); if (Path.GetExtension(assem.EscapedCodeBase).Equals(".dll", StringComparison.InvariantCultureIgnoreCase)) { string tmp = Path.GetFileNameWithoutExtension(assem.EscapedCodeBase); if (!imports.Contains(tmp)) { Import.JScriptImport(tmp, engine); } } Import.JScriptImport("System.Net", engine); Import.JScriptImport("System.IO", engine); //using System; //using System.IO; //using System.Net; //using System.Text; } catch { } } }