System.CodeDom.Compiler.CodeDomProvider.GetCompilerInfo Method

Returns the language provider and compiler configuration settings for the specified language.

Syntax

[System.Runtime.InteropServices.ComVisible(false)]
public static CompilerInfo GetCompilerInfo (string language)

Parameters

language
A language name.

Returns

A System.CodeDom.Compiler.CompilerInfo object populated with settings of the configured System.CodeDom.Compiler.CodeDomProvider implementation.

Remarks

The <system.codedom> in the machine configuration file contains the language provider and compiler configuration settings for each System.CodeDom.Compiler.CodeDomProvider implementation on the computer. For information about machine configuration files, see the Machine Configuration Files section in Configuration Files. The CodeDomProvider.GetCompilerInfo(string) method searches each provider configuration element for the specified language name. The returned System.CodeDom.Compiler.CompilerInfo instance contains the configured language provider and compiler settings.

The CodeDomProvider.IsDefinedLanguage(string) method checks whether at least one provider implementation supports a specific language. You can validate a language name using CodeDomProvider.IsDefinedLanguage(string) before passing it to CodeDomProvider.GetCompilerInfo(string). This prevents throwing a System.Configuration.ConfigurationException when you access the System.CodeDom.Compiler.CompilerInfo instance for an unsupported language name.

If more than one provider implementation is configured for the input language name, CodeDomProvider.GetCompilerInfo(string) returns the settings from the last matching provider configuration element.

Language names are case-insensitive.

Requirements

Namespace: System.CodeDom.Compiler
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0