Microsoft.CSharp.CSharpCodeProvider p = new CSharpCodeProvider();
ICodeCompiler compiler = p.CreateCompiler();
CompilerParameters options = new CompilerParameters(new string[] {"mscorlib.dll", "System.dll"}, myOutputAssemblyPath, true);
CompilerResults res = compiler.CompileAssemblyFromFileBatch(options, fileNames);
CompilerErrorCollection errors = res.Errors;
Assembly a = res.CompiledAssembly;