BuildProvider.GetDefaultCompilerTypeForLanguage(String) 方法       
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
根据指定的语言返回生成提供程序的编译器设置。
protected:
 System::Web::Compilation::CompilerType ^ GetDefaultCompilerTypeForLanguage(System::String ^ language);protected System.Web.Compilation.CompilerType GetDefaultCompilerTypeForLanguage(string language);member this.GetDefaultCompilerTypeForLanguage : string -> System.Web.Compilation.CompilerTypeProtected Function GetDefaultCompilerTypeForLanguage (language As String) As CompilerType参数
- language
- String
代码语言名称。
返回
CompilerType,根据指定的语言表示生成提供程序的编译器设置。 基类根据应用程序配置文件返回该语言的默认编译器设置。
例外
              language 为 null。
              language 与生成提供程序的已配置编译器不匹配。
注解
GetDefaultCompilerTypeForLanguage使用 方法检查生成提供程序中配置的特定语言名称的编译器类型。 GetDefaultCompilerType使用 方法检查生成提供程序的默认编译器类型。
基BuildProvider类使用 Compiler 配置文件对象的 CompilationSection 属性中的Compilers元素确定默认编译器类型。 这相当于检查配置文件各buildProviders节中的compilers元素和compiler元素。 例如,对于 language 值 VB,基类方法返回一个 CompilerType 对象,该对象对应于 实例的配置 Microsoft.VisualBasic.VBCodeProvider设置。
从 BuildProvider 类派生时,可以使用 GetDefaultCompilerTypeForLanguage 设置 CodeCompilerType 实现支持的语言的属性值。