Here it is straight out of the MSDN:
The .NET Framework class library includes types that correspond to the
primitive data types that compilers use. Of these types, the following are
CLS-compliant: Byte, Int16, Int32, Int64, Single, Double, Boolean, Char,
Decimal, IntPtr, and String. For more information about these types, see the
table of types in .NET Framework Class Library.
> > What are we supposed to use for a DateTime if we want to stay CLS
> > compliant????
>
> DateTime doesn't appear to be marked as not ClsCompliant. Where are you
> seeing that it is?
Shawn B. - 10 Dec 2004 22:02 GMT
It doesn't say that DateTime is not CLS compliant, what it is saying is that
the compiler has aliases that correspond to the CLS type. For example, in
C# you say "int" not "System.Int32", or "bool" and not "System.Boolean", and
so on. There is not C# keyword for System.DateTime so you just simply use
DateTime.
In VB, its similar, you say "Integer" instead of "System.Int32" and "Short"
instead of "System.Int16", except in this case, you can say "Date" instead
of "System.DateTime" because there is a keyword but C# has no keyword or
"alias".
The fact that it isn't listed doesn't mean that it is not CLS compliant,
simply just means there isn't a corresponding primitive data type that maps
to a type in the Framework somewhere.
Thanks,
Shawn
> Here it is straight out of the MSDN:
> The .NET Framework class library includes types that correspond to the
[quoted text clipped - 8 lines]
> > DateTime doesn't appear to be marked as not ClsCompliant. Where are you
> > seeing that it is?
Bruno Jouhier [MVP] - 14 Dec 2004 12:17 GMT
This list is about PRIMITIVE data types. The fact that DateTime is not
listed does not mean anything because DateTime is not a primitive type.
> Here it is straight out of the MSDN:
> The .NET Framework class library includes types that correspond to the
[quoted text clipped - 9 lines]
>> DateTime doesn't appear to be marked as not ClsCompliant. Where are you
>> seeing that it is?
Sorry, I forgot to send you the link
ms-help://MS.MSDNQTR.2004APR.1033/cpguide/html/cpconWhatIsCommonLanguageSpecification.htm