Edytuj

Udostępnij za pośrednictwem


BuildProvider.GetDefaultCompilerTypeForLanguage(String) Method

Definition

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

protected:
 System::Web::Compilation::CompilerType ^ GetDefaultCompilerTypeForLanguage(System::String ^ language);
protected System.Web.Compilation.CompilerType GetDefaultCompilerTypeForLanguage (string language);
member this.GetDefaultCompilerTypeForLanguage : string -> System.Web.Compilation.CompilerType
Protected Function GetDefaultCompilerTypeForLanguage (language As String) As CompilerType

Parameters

language
String

A code language name.

Returns

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.

Exceptions

language is null.

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

Remarks

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 buildProviders elements and the compiler elements in the compilers 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 you derive from the BuildProvider class, you can use GetDefaultCompilerTypeForLanguage to set the CodeCompilerType property value for the language supported by your implementation.

Applies to

See also