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


public sealed class UnsafeValueTypeAttribute : Attribute


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.


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