CodeDomProvider.CreateCompiler 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
Callers should not use the ICodeCompiler interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method.
警告
ICodeCompiler has been deprecated. Use the methods directly on the CodeDomProvider class instead. Classes inheriting from CodeDomProvider must still implement this interface, and should suppress this warning or also mark this method as obsolete.
在衍生類別中覆寫時,請建立新的程式碼編譯器。
public:
abstract System::CodeDom::Compiler::ICodeCompiler ^ CreateCompiler();
[System.Obsolete("Callers should not use the ICodeCompiler interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method.")]
public abstract System.CodeDom.Compiler.ICodeCompiler CreateCompiler ();
[System.Obsolete("ICodeCompiler has been deprecated. Use the methods directly on the CodeDomProvider class instead. Classes inheriting from CodeDomProvider must still implement this interface, and should suppress this warning or also mark this method as obsolete.")]
public abstract System.CodeDom.Compiler.ICodeCompiler CreateCompiler ();
public abstract System.CodeDom.Compiler.ICodeCompiler CreateCompiler ();
[<System.Obsolete("Callers should not use the ICodeCompiler interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method.")>]
abstract member CreateCompiler : unit -> System.CodeDom.Compiler.ICodeCompiler
[<System.Obsolete("ICodeCompiler has been deprecated. Use the methods directly on the CodeDomProvider class instead. Classes inheriting from CodeDomProvider must still implement this interface, and should suppress this warning or also mark this method as obsolete.")>]
abstract member CreateCompiler : unit -> System.CodeDom.Compiler.ICodeCompiler
abstract member CreateCompiler : unit -> System.CodeDom.Compiler.ICodeCompiler
Public MustOverride Function CreateCompiler () As ICodeCompiler
傳回
ICodeCompiler,可以用來編譯以 System.CodeDom 為基礎的原始程式碼表示。
- 屬性
備註
此方法在 .NET Framework 2.0 中已過時。 建議的替代方案是呼叫 ICodeCompiler 程式代碼提供者中直接可用的方法。
給實施者的注意事項
在 .NET Framework 2.0 中,您應該實ICodeCompiler作 類別中的CodeDomProvider成員,並在呼叫此方法時擲回 NotSupportedException 。