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.CompilerType
Protected Function GetDefaultCompilerTypeForLanguage (language As String) As CompilerType
參數
- language
- String
一個代號語言。
傳回
A CompilerType 代表根據指定語言編譯器建置提供者的設定。 基底類別會回傳根據應用程式設定檔的語言預設編譯器設定。
例外狀況
language 為 null。
language 與建置提供者的已設定編譯器不相符。
備註
使用該 GetDefaultCompilerTypeForLanguage 方法檢查建置提供者中特定語言名稱的編譯器類型。 使用該 GetDefaultCompilerType 方法檢查建置提供者的預設編譯器類型。
基底BuildProvider類別會利用Compiler設定檔物件屬性CompilationSection中的Compilers元素來決定預設編譯器的類型。 這等同於檢視buildProviders設定檔各區段的元素compilercompilers與元素。 例如,對於 language 值 VB,基底類別方法回傳 CompilerType 一個物件,對應於 的 Microsoft.VisualBasic.VBCodeProvider設定。
當你從 BuildProvider 類別衍生時,可以用來 GetDefaultCompilerTypeForLanguage 設定 CodeCompilerType 你實作所支援語言的屬性值。