public void Main(string[] args) { var assemblyReslover = new AspNet5AssemblyResolver(_libraryManager); var scriptServicesBuilder = new ScriptServicesBuilder(Console, new DefaultLogProvider()).Cache(false).Repl(true); scriptServicesBuilder = IsMono ? scriptServicesBuilder.ScriptEngine<MonoScriptEngine>() : scriptServicesBuilder.ScriptEngine<RoslynScriptEngine>(); ((ScriptServicesBuilder)scriptServicesBuilder).Overrides[typeof (IAssemblyResolver)] = assemblyReslover; var scriptcs = scriptServicesBuilder.Build(); scriptcs.Repl.Initialize(assemblyReslover.GetAssemblyPaths(string.Empty), Enumerable.Empty<IScriptPack>()); try { while (ExecuteLine(scriptcs.Repl)) { } Console.WriteLine(); } catch (Exception ex) { var oldColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex.Message); Console.ForegroundColor = oldColor; } }
public void Main(string[] args) { var assemblyReslover = new AspNet5AssemblyResolver(_libraryManager); var scriptServicesBuilder = new ScriptServicesBuilder(Console, new DefaultLogProvider()).Cache(false).Repl(true); scriptServicesBuilder = IsMono ? scriptServicesBuilder.ScriptEngine <MonoScriptEngine>() : scriptServicesBuilder.ScriptEngine <RoslynScriptEngine>(); ((ScriptServicesBuilder)scriptServicesBuilder).Overrides[typeof(IAssemblyResolver)] = assemblyReslover; var scriptcs = scriptServicesBuilder.Build(); scriptcs.Repl.Initialize(assemblyReslover.GetAssemblyPaths(string.Empty), Enumerable.Empty <IScriptPack>()); try { while (ExecuteLine(scriptcs.Repl)) { } Console.WriteLine(); } catch (Exception ex) { var oldColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex.Message); Console.ForegroundColor = oldColor; } }