BuildProvider.GetDefaultCompilerTypeForLanguage Method

Returns the compiler settings for the build provider based on the specified language.

Namespace: System.Web.Compilation
Assembly: System.Web (in system.web.dll)

protected CompilerType GetDefaultCompilerTypeForLanguage (
	string language
protected CompilerType GetDefaultCompilerTypeForLanguage (
	String language
protected function GetDefaultCompilerTypeForLanguage (
	language : String
) : CompilerType
Not applicable.



A code language name.

Return Value

A CompilerType that represents the compiler settings for the build provider based on the specified language. The base class returns the default compiler settings for the language based on the application configuration file.

Exception typeCondition


language is a null reference (Nothing in Visual Basic).


language does not match a configured compiler for the build provider.

Use the GetDefaultCompilerTypeForLanguage method to examine the compiler type configured in the build provider for a specific language name. Use the GetDefaultCompilerType method to examine the default compiler type for a build provider.

The base BuildProvider class determines the default compiler type using the Compiler elements in the Compilers property of the CompilationSection object for the configuration file. This is equivalent to examining the compiler Element for compilers for compilation (ASP.NET Settings Schema) elements in the system.web Element (ASP.NET Settings Schema) and the <compiler> Element elements in the <system.codedom> Element sections of the configuration file. For example, for the language value VB, the base class method returns a CompilerType object that corresponds to the configured settings for an instance of Microsoft.VisualBasic.VBCodeProvider.

When deriving from the BuildProvider class, you can use GetDefaultCompilerTypeForLanguage to set the CodeCompilerType property value for the language supported by your implementation.

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

Community Additions