ILGenerator.UsingNamespace Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Specifies the namespace to be used in evaluating locals and watches for the current active lexical scope.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overridable Sub UsingNamespace ( _
    usingNamespace As String _
)
public virtual void UsingNamespace(
    string usingNamespace
)

Parameters

  • usingNamespace
    Type: System.String
    The namespace to be used in evaluating locals and watches for the current active lexical scope

Exceptions

Exception Condition
ArgumentException

Length of usingNamespace is zero.

ArgumentNullException

usingNamespace is nulla null reference (Nothing in Visual Basic).

NotSupportedException

This ILGenerator belongs to a DynamicMethod.

Remarks

If the current ILGenerator is associated with a DynamicMethod object, this method is not supported.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.