BuildProvider.GetGeneratedType(CompilerResults) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回組建提供者從虛擬路徑產生的型別。
public:
virtual Type ^ GetGeneratedType(System::CodeDom::Compiler::CompilerResults ^ results);
public virtual Type GetGeneratedType(System.CodeDom.Compiler.CompilerResults results);
abstract member GetGeneratedType : System.CodeDom.Compiler.CompilerResults -> Type
override this.GetGeneratedType : System.CodeDom.Compiler.CompilerResults -> Type
Public Overridable Function GetGeneratedType (results As CompilerResults) As Type
參數
- results
- CompilerResults
組建提供者之虛擬路徑的編譯結果。
傳回
組建提供者為虛擬路徑產生的型別。 基底類別會傳回 null。
備註
若要實作產生 .aspx 檔案等 Web 內容的原始程式碼的組建提供者,請從 BuildProvider 類別衍生類別,並覆寫 GetGeneratedType 方法以傳回組建提供者所產生的類型。
ASP.NET 建置系統會編譯每個組建提供者的檔案,並產生 CompilerResults 物件,該物件會傳遞至 GetGeneratedType 方法。 一般而言,組建提供者的實作 GetGeneratedType 會在 GetType 輸入 results 物件的 屬性上使用 CompiledAssembly 方法,以傳回提供的型別。