Quote Originally Posted by jmcilhinney View Post
There's no acting. All structures, including Int32, are derived from the System.ValueType class, which inherits Object. Absolutely every type in the .NET Framework is derived from the Object class. Just read the documentation for any type and check its inheritance hierarchy. You'll see that every single one of them starts at System.Object.
I say acting because I looked at IL generated. That code isn't on this system, but the basics were that a locally declared integer is a storage location into which you can assign a literal integer. If you then assign that integer to a variable of type object, there's that call to box. If you use the integer directly as an integer, it never appears to generate anything other than would be expected for the integer to be anything other than a value, which is unlike classes, but I suppose that the two really couldn't look the same in IL, and I could be misunderstanding what is happening there.