Table of Contents

Class CSharpCompiler

Namespace
Ecng.Compilation.Roslyn
Assembly
Ecng.Compilation.Roslyn.dll

Represents a C# compiler that supports compiling source files into an assembly.

public class CSharpCompiler : RoslynCompiler, ICompiler
Inheritance
CSharpCompiler
Implements
Inherited Members
Extension Methods

Constructors

CSharpCompiler()

Initializes a new instance of the CSharpCompiler class.

public CSharpCompiler()

Properties

IsCaseSensitive

Gets a value indicating whether the language is case sensitive.

public override bool IsCaseSensitive { get; }

Property Value

bool

IsReferencesSupported

Gets a value indicating whether the compiler supports external references.

public override bool IsReferencesSupported { get; }

Property Value

bool

IsTabsSupported

Gets a value indicating whether the compiler supports tabs in the source code.

public override bool IsTabsSupported { get; }

Property Value

bool

Methods

Create(string, IEnumerable<string>, PortableExecutableReference[], CancellationToken)

Creates a new compilation instance.

protected override Compilation Create(string assemblyName, IEnumerable<string> sources, PortableExecutableReference[] references, CancellationToken cancellationToken)

Parameters

assemblyName string

The name of the assembly.

sources IEnumerable<string>

The source code files as strings.

references PortableExecutableReference[]

A collection of references.

cancellationToken CancellationToken

CancellationToken

Returns

Compilation

Microsoft.CodeAnalysis.Compilation