I am using the IMetaDataImport API and and I need to determine if the type definitions in my assembly are value or reference types. I have not found any method in the API that explicitely provides this information. However, I can easily enough obtain the base type and check if it is System.ValueType.
My question is: is the base class the only way through which CLI metadata encodes the fact that a type is a value type or are there some flags for this somewhere?
There are no flags that identify value types directly. It looks like checking the base type, along with a couple of other things, is the canonical way to do it.
Section II.10.1.3 of the ECMA CLI spec describes the type definition like this: