CodeDomProvider.GetAllCompilerInfo Method

Returns the language provider and compiler configuration settings for this computer.

Namespace: System.CodeDom.Compiler
Assembly: System (in system.dll)

public static CompilerInfo[] GetAllCompilerInfo ()
/** @attribute ComVisibleAttribute(false) */ 
public static CompilerInfo[] GetAllCompilerInfo ()
public static function GetAllCompilerInfo () : CompilerInfo[]
Not applicable.

Return Value

An array of type CompilerInfo representing the settings of all configured CodeDomProvider implementations.

Exception typeCondition


The caller does not have the required permission.

Use the GetAllCompilerInfo method to enumerate the language provider settings on a computer.


In the Microsoft .NET Framework version 2.0, the default language providers supplied by the .NET Framework are not specified in the <system.codedom> Element compiler configuration section and cannot be removed, so this method returns information about the default providers and any specified in the configuration file.

The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider.

CompilerInfo [] allCompilerInfo = CodeDomProvider.GetAllCompilerInfo();
foreach (CompilerInfo info in allCompilerInfo)
    String defaultLanguage;
    String defaultExtension;

    CodeDomProvider provider = info.CreateProvider();

    // Display information about this configured provider.

    Console.WriteLine("Language provider:  {0}", 
    Console.WriteLine("  Supported file extension(s):");
    foreach(String extension in info.GetExtensions())
        Console.WriteLine("    {0}", extension);
    defaultExtension = provider.FileExtension;
    if (defaultExtension[0] != '.')
        defaultExtension = "." + defaultExtension;
    Console.WriteLine("  Default file extension:  {0}", 

    Console.WriteLine("  Supported language(s):");
    foreach(String language in info.GetLanguages())
        Console.WriteLine("    {0}", language);

    defaultLanguage = CodeDomProvider.GetLanguageFromExtension(defaultExtension);
    Console.WriteLine("  Default language:        {0}",

    // Get the compiler settings for this provider.
    CompilerParameters langCompilerConfig = info.CreateDefaultCompilerParameters();

    Console.WriteLine("  Compiler options:        {0}", 
    Console.WriteLine("  Compiler warning level:  {0}", 

  • SecurityAction.LinkDemand  for full trust for the immediate caller. This member cannot be used by partially trusted code.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0