Share via


BuildProvider.GetDefaultCompilerTypeForLanguage(String) 方法

定义

根据指定的语言返回生成提供程序的编译器设置。

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

参数

language
String

代码语言名称。

返回

CompilerType,根据指定的语言表示生成提供程序的编译器设置。 基类根据应用程序配置文件返回该语言的默认编译器设置。

例外

languagenull

language 与生成提供程序的已配置编译器不匹配。

注解

GetDefaultCompilerTypeForLanguage使用 方法检查生成提供程序中配置的特定语言名称的编译器类型。 GetDefaultCompilerType使用 方法检查生成提供程序的默认编译器类型。

BuildProvider类使用 Compiler 配置文件对象的 CompilationSection 属性中的Compilers元素确定默认编译器类型。 这相当于检查配置文件各buildProviders节中的compilers元素和compiler元素。 例如,对于 languageVB,基类方法返回一个 CompilerType 对象,该对象对应于 实例的配置 Microsoft.VisualBasic.VBCodeProvider设置。

BuildProvider 类派生时,可以使用 GetDefaultCompilerTypeForLanguage 设置 CodeCompilerType 实现支持的语言的属性值。

适用于

另请参阅