Show / Hide Table of Contents

Class CsharpCompiler

Utility class wrapping the Roslyn (C# compiler) APIs in something slightly easier to use.

Inheritance
Object
CsharpCompiler
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Mangrove.MetricSetEmitters
Assembly: MetricSetEmitters.dll
Syntax
public class CsharpCompiler

Methods

View Source

Compile(String, String, IEnumerable<String>, IEnumerable<String>)

Compile the C# code in csharp into an assembly with given name. This method uses a sensible default set of assembly references, but additional ones may be specified if desired.

Declaration
public (MemoryStream Assembly, string Error) Compile(string csharp, string assemblyName, IEnumerable<string> assemblies = null, IEnumerable<string> assembliesPath = null)
Parameters
Type Name Description
String csharp

C# code to compile.

String assemblyName
IEnumerable<String> assemblies

If provided, list of assembly names to reference.

IEnumerable<String> assembliesPath

If provided, list of assembly path to reference.

Returns
Type Description
ValueTuple<MemoryStream, String>

Extension Methods

ObjectExtensions.EventId(Object)
  • View Source
Back to top Generated by DocFX