System.CodeDom.Compiler.CodeDomProvider Class

Provides a base class for System.CodeDom.Compiler.CodeDomProvider implementations. This class is abstract.

See Also: CodeDomProvider Members


public abstract class CodeDomProvider : System.ComponentModel.Component


A System.CodeDom.Compiler.CodeDomProvider can be used to create and retrieve instances of code generators and code compilers. Code generators can be used to generate code in a particular language, and code compilers can be used to compile code into assemblies.


In the dnprdnext, the methods made available in the code generator and code compiler are available directly from the code provider. You do not need to call CodeDomProvider.CreateGenerator or CodeDomProvider.CreateCompiler to access the methods, and those methods are marked as obsolete. This applies to preexisting as well as new code provider implementations.

A System.CodeDom.Compiler.CodeDomProvider implementation typically provides code generation and/or code compilation interfaces for generating code and managing compilation for a single programming language. Several languages are supported by System.CodeDom.Compiler.CodeDomProvider implementations that ship with the winsdklong. These languages include C#, Visual Basic, C++, and JScript. Developers or compiler vendors can implement the System.CodeDom.Compiler.ICodeGenerator and System.CodeDom.Compiler.ICodeCompiler interfaces and provide a System.CodeDom.Compiler.CodeDomProvider that extends CodeDOM support to other programming languages.

The <system.codedom> in the machine configuration file (Machine.config) provides a mechanism for developers and compiler vendors to add configuration settings for additional System.CodeDom.Compiler.CodeDomProvider implementations.

The System.CodeDom.Compiler.CodeDomProvider class provides static methods to discover and enumerate the System.CodeDom.Compiler.CodeDomProvider implementations on a computer. The CodeDomProvider.GetAllCompilerInfo method returns the settings for all System.CodeDom.Compiler.CodeDomProvider implementations on a computer. The CodeDomProvider.GetCompilerInfo(string) method returns the settings for a specific System.CodeDom.Compiler.CodeDomProvider implementation, based on the programming language name. The CodeDomProvider.CreateProvider(string) method returns an instance of a System.CodeDom.Compiler.CodeDomProvider implementation for a specific language.

For more details on language provider settings in the configuration file, see Compiler and Language Provider Settings Schema.


This class makes a link demand and an inheritance demand at the class level. A System.Security.SecurityException is thrown if either the immediate caller or the derived class does not have full trust permission. For details about security demands, see Link Demands and Inheritance Demands.


Namespace: System.CodeDom.Compiler
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,