System.Runtime.CompilerServices.UnsafeValueTypeAttribute Class

Specifies that a type contains an unmanaged array that might potentially overflow. This class cannot be inherited.

See Also: UnsafeValueTypeAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Struct)]
public sealed class UnsafeValueTypeAttribute : Attribute

Remarks

Use the System.Runtime.CompilerServices.UnsafeValueTypeAttribute class to instruct the common language runtime (CLR) that a type contains an unmanaged array that can potentially overflow. When this attribute is encountered, the CLR inserts runtime checks to prevent the array from overflowing and to prevent buffer overrun attacks.

This class is used by the Microsoft Visual C++ and the Microsoft Visual C# compilers.

Requirements

Namespace: System.Runtime.CompilerServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0