Why CLS-compliant warning?

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
 
M

Michel Posseth [MCP]

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
 
J

Jack Jackson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top