public void SizeOf_Tests() { Console.WriteLine("Int: " + sizeof(int)); // Int: 4 //Console.WriteLine("TestStruct: " + sizeof(TestStruct)); // error Console.WriteLine("Dyn Int: " + MiscUtils.DynSizeOf <int>()); // Dyn Int: 4 Console.WriteLine("Dyn TestStruct: " + MiscUtils.DynSizeOf <TestStruct>()); // Dyn TestStruct: 8 Console.WriteLine("Dyn TestStructNoPad: " + MiscUtils.DynSizeOf <TestStructNoPad>()); // Dyn TestStructNoPad: 5 }