Why is “long” being allowed as array length in C#?-Collection of common programming errors
It is a limitation of the CLR, no single object can exceed 2GB, including arrays:
Large array C# OutOfMemoryException
This is regardless of 32-bit or 64-bit OSs. That said, it doesn’t stop you from using more than that amount in total, just not on one object.
It is a runtime error because if you keep the long (or other initializing value) within range, it will work.
You can initialize arrays with all integral types: sbyte, char, short, int, and long – all compile; the unsigned variants work too.