![]() | RoslynEvaluatorCompileCode Method (String, CompileInfo) |
The method is identical to CompileCode(String) except that it allows specifying the destination assembly file.
Namespace: CSScriptLib
public Assembly CompileCode( string scriptText, CompileInfo info = null )
var info = new CompileInfo { AssemblyFile = @"E:\temp\asm.dll" }; Assembly asm = CSScript.Evaluator .Cast<RoslynEvaluator>() .CompileCode(@"using System; public class Script { public int Sum(int a, int b) { return a+b; } }", info); dynamic script = asm.CreateObject("*"); var result = script.Sum(7, 3);