 | IEvaluatorCompileAssemblyFromCode Method |
Compiles C# code (script) into assembly file. The C# code is a typical C# code containing a single or multiple class definition(s).
Namespace:
CSScriptLib
Assembly:
CSScriptLib (in CSScriptLib.dll) Version: 1.3.2.0
Syntaxstring CompileAssemblyFromCode(
string scriptText,
string outputFile
)
Parameters
- scriptText
- Type: SystemString
The C# script text. - outputFile
- Type: SystemString
The path to the assembly file to be compiled.
Return Value
Type:
StringThe compiled assembly file path.
Examplesstring asmFile = CSScript.Evaluator
.CompileAssemblyFromCode(
@"using System;
public class Script
{
public int Sum(int a, int b)
{
return a+b;
}
}",
"MyScript.dll");
See Also