AssemblyBuilder.SetEntryPoint Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the entry point for this dynamic assembly.
Overloads
SetEntryPoint(MethodInfo) |
Sets the entry point for this dynamic assembly, assuming that a console application is being built. |
SetEntryPoint(MethodInfo, PEFileKinds) |
Sets the entry point for this assembly and defines the type of the portable executable (PE file) being built. |
SetEntryPoint(MethodInfo)
Sets the entry point for this dynamic assembly, assuming that a console application is being built.
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)
Parameters
- entryMethod
- MethodInfo
A reference to the method that represents the entry point for this dynamic assembly.
Exceptions
entryMethod
is null
.
entryMethod
is not contained within this assembly.
The caller does not have the required permission.
Applies to
SetEntryPoint(MethodInfo, PEFileKinds)
Sets the entry point for this assembly and defines the type of the portable executable (PE file) being built.
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)
Parameters
- entryMethod
- MethodInfo
A reference to the method that represents the entry point for this dynamic assembly.
- fileKind
- PEFileKinds
The type of the assembly executable being built.
Exceptions
entryMethod
is null
.
entryMethod
is not contained within this assembly.
The caller does not have the required permission.
Remarks
Note
Starting with the .NET Framework 2.0 Service Pack 1, this member no longer requires ReflectionPermission with the ReflectionPermissionFlag.ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the .NET Framework 3.5 or later.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈