This kind of code is fundamentally unsafe, it defeats the compiler's type system. And won't be accepted by the verifier. If you accidentally declare the array wrong, 3 elements for example, then you'll corrupt memory and produce a very hard to diagnose bug.
This can however also be done safely:
byte[] test = BitConverter.GetBytes(0xaabbccdd);
Which the slight disadvantage that it creates the array for you. Bypassing that requires the unsafe version:
fixed (byte* ptr = test)
{
*((uint*)ptr) = 0xaabbccdd;
}
Which requires you to use the unsafe keyword in the method declaration and tick the Project + Properties, Build, "Allow unsafe code" option.
fixedstatement) to lock down the memory so it's not garbage collected...