Why CLS-compliant warning?

  • Thread starter Thread starter harrym55
  • Start date Start date
H

harrym55

Hi,

I receive warning for the following enum:

Public Enum enumMinOrMax
Min
Max
End Enum

Warning 20 Type of parameter 'MinOrMax' is not CLS-compliant.

This enum is contained in a different project from the code that
triggers this warning.

I noticed code in the same project using this enum doesn't trigger
this warning so I'm guessing using enum from another project (in the
same solution) causes this warning.
If so, how should one code when multiple projects within the one
solution require access to the same enum but in a different project?
I'd rather avoid copies of the same enum in each project simply to
avoid this warning.

thanks
harry
 
add this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

And make sure the dll's you are referencing, especially the one that
contains the Enum is also marked with the same attribute
 
What causes the warning?

add this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

And make sure the dll's you are referencing, especially the one that
contains the Enum is also marked with the same attribute
 
Back
Top