📅  最后修改于: 2022-03-11 14:48:45.739000             🧑  作者: Mango
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);