I am new to C#, and believe I am missing something. The following portion of the code builds the message body of the packet to be sent. During compilation, it throws the error.
Buffer.BlockCopy(BitConverter.GetBytes((short)1), 0, packet.Message, 0, 2);
CS0117: 'bool' does not contain a definition for 'BlockCopy'
I cannot see why the compiler thinks I am passing any boolean value as an argument to BlockCopy. (short)1 makes an int16, GetBytes creates an array[16] of bytes, and the other 4 arguments are standard. Am I missing something?
Buffer.BlockCopy(BitConverter.GetBytes((short)1), 0, packet.Message, 0, 2);
CS0117: 'bool' does not contain a definition for 'BlockCopy'
I cannot see why the compiler thinks I am passing any boolean value as an argument to BlockCopy. (short)1 makes an int16, GetBytes creates an array[16] of bytes, and the other 4 arguments are standard. Am I missing something?