Simple solution compiler?

  • Thread starter Thread starter pnp
  • Start date Start date
P

pnp

Is there a way to make a simple compiler that builds cs projects in a
solution?

thanks in advance,
peter
 
Hi,
You can use the following command in a batch file (.bat)

devenv "<solutionfile>" /build "<debug/release>"

This builds all the projects under the .sln file
 
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;
 
Back
Top