AssemblyBuilder.SetEntryPoint Method
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.
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. |
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
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 1.1, 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 |
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
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 1.1, 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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: