Class RoslynCompilerUtils
Helper class to use the Roslyn compiler platform with predefined configurations
for optimization and an in memory compilation with all .net core necessary dependencies.
Inheritance
System.Object
RoslynCompilerUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Core.Data.Compiler
Assembly: Mars.Core.dll
Syntax
public static class RoslynCompilerUtils
Methods
| Improve this Doc View SourceCompileSourceCode(String, IEnumerable<String>, out IEnumerable<Diagnostic>)
Compile a code file and load it into the running program.
Declaration
public static Assembly CompileSourceCode(string codeFile, IEnumerable<string> dependencies, out IEnumerable<Diagnostic> diagnostics)
Parameters
Type | Name | Description |
---|---|---|
System.String | codeFile | The complete source code file. |
System.Collections.Generic.IEnumerable<System.String> | dependencies | All referenced DLLs needed for compilation. |
System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Diagnostic> | diagnostics | Out parameter with all compiler diagnostics for infos, warnings and errors |
Returns
Type | Description |
---|---|
System.Reflection.Assembly | Compiled and loaded DLL or 'null', if any compilation error occured. |