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
程式碼語言名稱。
表示根據指定語言之組建提供者編譯器設定的 CompilerType。 基底類別會根據應用程式組態檔傳回預設的編譯器語言設定。
language
為 null
。
language
與組建提供者的組態編譯器不相符。
GetDefaultCompilerTypeForLanguage使用 方法來檢查建置提供者中針對特定語言名稱所設定的編譯器類型。 GetDefaultCompilerType使用 方法來檢查組建提供者的預設編譯器類型。
基 BuildProvider 類會使用 Compiler 組態檔 物件的 屬性 CompilationSection 中的 Compilers 專案來決定預設編譯器類型。 這相當於檢查組態檔區段中的專案 buildProviders
和 compiler
元素 compilers
。 例如,針對 language
值 VB
,基類方法會 CompilerType 傳回 物件,該物件會對應至 實例 Microsoft.VisualBasic.VBCodeProvider 的已設定設定。
當您衍生自 類別時 BuildProvider ,您可以使用 GetDefaultCompilerTypeForLanguage 來設定 CodeCompilerType 實作所支援語言的屬性值。
產品 | 版本 |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |