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 專案來決定預設編譯器類型。 這相當於檢查組態檔區段中的專案 buildProviderscompiler 元素 compilers 。 例如,針對 languageVB ,基類方法會 CompilerType 傳回 物件,該物件會對應至 實例 Microsoft.VisualBasic.VBCodeProvider 的已設定設定。

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

適用於

另請參閱