共用方式為


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

一個代號語言。

傳回

A CompilerType 代表根據指定語言編譯器建置提供者的設定。 基底類別會回傳根據應用程式設定檔的語言預設編譯器設定。

例外狀況

languagenull

language 與建置提供者的已設定編譯器不相符。

備註

使用該 GetDefaultCompilerTypeForLanguage 方法檢查建置提供者中特定語言名稱的編譯器類型。 使用該 GetDefaultCompilerType 方法檢查建置提供者的預設編譯器類型。

基底BuildProvider類別會利用Compiler設定檔物件屬性CompilationSection中的Compilers元素來決定預設編譯器的類型。 這等同於檢視buildProviders設定檔各區段的元素compilercompilers與元素。 例如,對於 languageVB,基底類別方法回傳 CompilerType 一個物件,對應於 的 Microsoft.VisualBasic.VBCodeProvider設定。

當你從 BuildProvider 類別衍生時,可以用來 GetDefaultCompilerTypeForLanguage 設定 CodeCompilerType 你實作所支援語言的屬性值。

適用於

另請參閱