Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DefineLocalVariable Method

ISymbolWriter.DefineLocalVariable Method

Defines a single variable in the current lexical scope.

Namespace:  System.Diagnostics.SymbolStore
Assembly:  mscorlib (in mscorlib.dll)

void DefineLocalVariable(
	string name,
	FieldAttributes attributes,
	byte[] signature,
	SymAddressKind addrKind,
	int addr1,
	int addr2,
	int addr3,
	int startOffset,
	int endOffset
)

Parameters

name
Type: System.String

The local variable name.

attributes
Type: System.Reflection.FieldAttributes

A bitwise combination of the local variable attributes.

signature
Type: System.Byte[]

The local variable signature.

addrKind
Type: System.Diagnostics.SymbolStore.SymAddressKind

The address types for addr1, addr2, and addr3.

addr1
Type: System.Int32

The first address for the local variable specification.

addr2
Type: System.Int32

The second address for the local variable specification.

addr3
Type: System.Int32

The third address for the local variable specification.

startOffset
Type: System.Int32

The start offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope.

endOffset
Type: System.Int32

The end offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope.

The startOffset and endOffset parameters are optional. If their value is zero, they are ignored and the variable is defined throughout the entire scope. If their value is nonzero, the variable falls within the offsets of the current scope.

You can call DefineLocalVariable multiple times for a variable of the same name that occurs multiple times in different offset ranges throughout a scope. (In this case, start and end offsets must not overlap.)

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft