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
.NET
피드백
https://aka.ms/ContentUserFeedback을 참조하세요.
출시 예정: 2024년 내내 콘텐츠 피드백 메커니즘인 GitHub 문제를 단계적으로 폐지하고 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은다음에 대한 사용자 의견 제출 및 보기