Okay, the title was just too convenient to pass up, but this post is really a bit about nullable types and compatibility with .NET 1.1 code.
I was surprised to find that .NET 2.0 nullable types, when passed to code compiled by .NET 1.1, are not recognized as null, even when that library is being hosted by the 2.0 VM.
Now, I would not expect to be able to pass a nullable type into a 1.1 method expecting its non-nullable type without first casting it to that type. However, when passing it to a method expecting an object, I would expect it to be able to slide in just fine.
Not so.
int? i = GetInt("/foo/missingint");
Assert.IsTrue(i == null); // passes
Assert.IsNull(i); // fails
Changing int? i to object i didn’t work either. It may be that auto-boxed types—at least 1.1’s implementation—are incompatible with nullable types.