Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CSharpCodeProvider.CreateCompiler Method

Gets an instance of the C# code compiler.

[Visual Basic]
Overrides Public Function CreateCompiler() As ICodeCompiler
[C#]
public override ICodeCompiler CreateCompiler();
[C++]
public: ICodeCompiler* CreateCompiler();
[JScript]
public override function CreateCompiler() : ICodeCompiler;

Return Value

An instance of the C# ICodeCompiler implementation.

Example

[Visual Basic] 
' Create an instance of the CSharpCodeProvider class.
Dim provider = New CSharpCodeProvider()
' Call the CodeDomProvider.CreateCompiler() method to obtain an ICodeCompiler from the provider.
Dim compiler As System.CodeDom.Compiler.ICodeCompiler = provider.CreateCompiler()

[C#] 
// Create an instance of the CSharpCodeProvider class.
Microsoft.CSharp.CSharpCodeProvider provider = new CSharpCodeProvider();
// Call the CodeDomProvider.CreateCompiler() method to obtain an ICodeCompiler from the provider.
System.CodeDom.Compiler.ICodeCompiler compiler = provider.CreateCompiler();

[C++] 
// Create an instance of the CSharpCodeProvider class.
Microsoft::CSharp::CSharpCodeProvider* provider = new CSharpCodeProvider();
// Call the CodeDomProvider.CreateCompiler() method to obtain an ICodeCompiler from the provider.
System::CodeDom::Compiler::ICodeCompiler* compiler = provider->CreateCompiler();

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CSharpCodeProvider Class | CSharpCodeProvider Members | Microsoft.CSharp Namespace | ICodeCompiler

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft