c# - Return string from Main() with CSharpCodeProvider -
i'm trying compile c# code(nothing complex, main() ) using csharpcodeprovider. code returns string, can't understand how pass value function. possible?
public string execute(list<string> code, list<string> _referencedassemblies) { compilerparameters cp = new compilerparameters(); (int = 0; < _referencedassemblies.count; i++) { cp.referencedassemblies.add(_referencedassemblies[i]); } stringbuilder sb = new stringbuilder(); (int = 0; < code.count; i++) { sb.append(code[i]); } csharpcodeprovider provider = new csharpcodeprovider(); compilerresults result = provider.compileassemblyfromsource(cp, sb.tostring());
Comments
Post a Comment