static BatchCompiler NewBatchCompiler() { if (current != null) { AppDomain.Unload(current); } current = AppDomain.CreateDomain("test"); BatchCompiler compiler = (BatchCompiler)current.CreateInstanceAndUnwrap( Assembly.GetExecutingAssembly().FullName, "Verifier.BatchCompiler"); return(compiler); }
public static void Main(String[] args) { int total = 0; BatchCompiler bc = NewBatchCompiler(); foreach (string src in Directory.GetFiles(".", "*.il")) { if (bc.Compile(src)) { ++total; } bc = NewBatchCompiler(); } Console.WriteLine("Total compiled successfully {0}", total); }