This documentation is archived and is not being maintained.

ISymbolWriter.OpenScope Method

Opens a new lexical scope in the current method.

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

int OpenScope (
	int startOffset
int OpenScope (
	int startOffset
function OpenScope (
	startOffset : int
) : int
Not applicable.



The offset in bytes from the beginning of the method to the first instruction in the lexical scope.

Return Value

An opaque scope identifier that can be used with SetScopeRange to define the start and end offsets of a scope at a later time. In this case, the offsets passed to OpenScope and CloseScope are ignored. A scope identifier is valid only in the current method.

This scope becomes the new current scope and is pushed onto a stack of scopes. Scopes must form a hierarchy. Siblings are not allowed to overlap.

Scope identifiers are only valid in the current method.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0