public RoslynEval() { if (probing == null) { probing = SimpleAsmProbing.For(".", @"..\..\..\Roslyn.Scripting"); } }
static string Compile(string compiler, string[] args) { // Debug.Assert(false); using (SimpleAsmProbing.For(Path.GetDirectoryName(csc))) { var oldOut = Console.Out; using StringWriter buff = new(); Console.SetOut(buff); int exitCode = 0; try { if (compiler == "csc") { exitCode = AppDomain.CurrentDomain.ExecuteAssembly(csc, args); } else { var vbc = Path.Join(Path.GetDirectoryName(csc), "vbc.dll"); exitCode = AppDomain.CurrentDomain.ExecuteAssembly(vbc, args); } } catch (Exception e) { return($"1|Build server error: {e}"); } finally { Console.SetOut(oldOut); } return($"{exitCode}|{buff.GetStringBuilder()}"); } }
public TestBase() { if (probing == null) { probing = SimpleAsmProbing.For(".", @"..\..\..\Roslyn.Scripting"); } Environment.SetEnvironmentVariable("CSSCRIPT_DIR", Environment.CurrentDirectory); }