user20088
0
Q:

c# compile code at runtime

using System.CodeDom.Compiler;

CSharpCodeProvider codeProvider = new CSharpCodeProvider();
CompilerParameters myParameters = new CompilerParameters();
myParameters.GenerateExecutable = false;
myParameters.OutputAssembly = @"C:\assembly.dll";
CompilerResults results = codeProvider.CompileAssemblyFromSource(myParameters, code);
1

New to Communities?

Join the community