AssemblyBuilder.SetEntryPoint 方法

定義

設定這個動態組件的進入點。

多載

SetEntryPoint(MethodInfo)

設定這個動態組件的進入點,並假設正在建立主控台應用程式。

SetEntryPoint(MethodInfo, PEFileKinds)

設定這個組件的進入點和定義正在建置之可攜式執行檔 (PE 檔) 的類型。

SetEntryPoint(MethodInfo)

設定這個動態組件的進入點,並假設正在建立主控台應用程式。

public:
 void SetEntryPoint(System::Reflection::MethodInfo ^ entryMethod);
public void SetEntryPoint (System.Reflection.MethodInfo entryMethod);
member this.SetEntryPoint : System.Reflection.MethodInfo -> unit
Public Sub SetEntryPoint (entryMethod As MethodInfo)

參數

entryMethod
MethodInfo

方法的參考,代表這個動態組件的進入點。

例外狀況

entryMethodnull

entryMethod 未包含在這個組件中。

呼叫端沒有必要的權限。

適用於

SetEntryPoint(MethodInfo, PEFileKinds)

設定這個組件的進入點和定義正在建置之可攜式執行檔 (PE 檔) 的類型。

public:
 void SetEntryPoint(System::Reflection::MethodInfo ^ entryMethod, System::Reflection::Emit::PEFileKinds fileKind);
public void SetEntryPoint (System.Reflection.MethodInfo entryMethod, System.Reflection.Emit.PEFileKinds fileKind);
member this.SetEntryPoint : System.Reflection.MethodInfo * System.Reflection.Emit.PEFileKinds -> unit
Public Sub SetEntryPoint (entryMethod As MethodInfo, fileKind As PEFileKinds)

參數

entryMethod
MethodInfo

方法的參考,代表這個動態組件的進入點。

fileKind
PEFileKinds

正在建置之組件可執行檔的類型。

例外狀況

entryMethodnull

entryMethod 未包含在這個組件中。

呼叫端沒有必要的權限。

備註

注意

從 .NET Framework 2.0 Service Pack 1 開始,此成員不再需要 ReflectionPermissionReflectionPermissionFlag.ReflectionEmit標。 (請參閱反映發出中的安全性問題 ) 若要使用這項功能,您的應用程式應以 .NET Framework 3.5 或更新版本為目標。

適用於