Home All Groups Group Topic Archive Search About

Interop class not CLS-compliant

Author
28 Jun 2006 4:27 PM
mhuhn.de
I have imported a C++ class into a .NET solution and use this class as
the return type for a method declared in an interface. Framework 2.0
gives me a warning that the method is not CLS compliant. I could add an
CLSCompliant attribute to all the methods in classes but not in the
method of the interface. Declaring the interface as non compliant
results in 40 more warnings for all the methods that use this
interface.

What is the best way to remove the warnings as I guess I cannot make
the class CLS compliant without rewriting it?

Author
28 Jun 2006 4:51 PM
Jared Parsons
Hello mhuhn***@gmail.com,

> What is the best way to remove the warnings as I guess I cannot make
> the class CLS compliant without rewriting it?

One option is to make the entire assembly non-cls compliant.  That should
stop all of the warnings.  See the following article for a way to mark the
assembly as such.

http://msdn2.microsoft.com/en-us/library/ms182156.aspx

--
Jared Parsons [MSFT]
jared***@online.microsoft.com