2

Is there a way to ensure that other .NET languages will interoperate with my C# classes ?

Tilak
  • 30,108
  • 19
  • 83
  • 131
Ron_B
  • 66
  • 7

2 Answers2

3

Yes, decorate your assembly with CLSCompliant attribute.

Making your code CLS Compliant

Tilak
  • 30,108
  • 19
  • 83
  • 131
3

The most important thing would be for you to use the CLSCompliantAttribute. This prevents you from inadvertently using non CLS compliant features in C#.

There are a few pretty obvious rules that I can mention here. Note, this list is not exhaustive. I just wanted to point our some of the rules to give you a feel of what CLS compliance is all about.

  • Do not use unsafe types (pointers) in the public interface.
  • Do not mix member name casing in the public interface.
  • Do not use unsigned types in the public interface.

Read the article Cross Language Interoperability for more information.

Brian Gideon
  • 47,849
  • 13
  • 107
  • 150