How to: Detect /clr Compilation
Visual Studio 2010
Use the _MANAGED or _M_CEE macro to see if a module is compiled with /clr. For more information, see /clr (Common Language Runtime Compilation).
For more information about macros, see Predefined Macros.