CSharpCompiler

Ecng.Compilation.Roslyn

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

继承自: RoslynCompiler

构造函数

CSharpCompiler
public CSharpCompiler()
cSharpCompiler = CSharpCompiler()

Initializes a new instance of the CSharpCompiler class.

属性

IsCaseSensitive
public override bool IsCaseSensitive { get; }
value = cSharpCompiler.IsCaseSensitive

Gets a value indicating whether the language is case sensitive.

IsReferencesSupported
public override bool IsReferencesSupported { get; }
value = cSharpCompiler.IsReferencesSupported

Gets a value indicating whether the compiler supports external references.

IsTabsSupported
public override bool IsTabsSupported { get; }
value = cSharpCompiler.IsTabsSupported

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

方法

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

Creates a new compilation instance.

assemblyName
The name of the assembly.
sources
The source code files as strings.
references
A collection of references.
cancellationToken
CancellationToken

返回值: Compilation