ILGenerator.ILOffset 属性

定义

获取由 ILGenerator 发出的 Microsoft 中间语言 (MSIL) 流中的当前偏移量(以字节为单位)。

public:
 virtual property int ILOffset { int get(); };
public:
 property int ILOffset { int get(); };
public virtual int ILOffset { get; }
public int ILOffset { get; }
member this.ILOffset : int
Public Overridable ReadOnly Property ILOffset As Integer
Public ReadOnly Property ILOffset As Integer

属性值

Int32

MSIL 流中的偏移量,将在此处发出下一个指令。

注解

此方法是透明的,可以从部分受信任的代码调用。

如果在发出任何 MSIL 指令之前访问该 ILOffset 属性,则返回 0 (零) 。

为动态语言生成 MSIL 时,此属性可用于将 MSIL 流中的偏移量映射到源代码行号。 引发异常时,可以使用生成的信息来提供堆栈跟踪。

适用于