cls

What are the more advanced rules needed for your code to become CLS-complaint?

Here is a specific example which is not CLS-complaint according to VS.NET 2005. Public Interface IDbId Function GetNativeObject() As Object Function Equals(ByVal compObj As IDbId) As Boolean Function CompareTo(ByVal compObj As IDbId) As Integer Function ToString() As String End Interface This is an interface I implement with cla...

What are the consequences of NON-CLS Compliant code in .NET?

I have a couple of nagging compiler warnings for an app that I ported from VB6 a while back regarding CLS-Compliance including: Name '_AnIdentifier' is not CLS-Compliant. Type of parameter 'myType' is not CLS-Compliant. Despite this, my app seems to perform just fine from COM and Managed clients. I have seen several articles describin...

Is there a tool for checking CLS Compliance

Is there a tool out there that anyone knows of that can analyse my .net code (C# and vb.net) and tell me why things are not CLS Compliant? Visual Studio is happy to tell me a parameter is not CLS compliant, but it gets me no closer to fixing the problem as i don't know the cause. Example VS Error: parameter 'xyz' is not CLS-Compliant ...

When is it acceptable to break CLS compliance?

I was wondering which edge cases exist that could make Common Language Specification compliance acceptable. Even when not intending to be accessed from other languages, I think that the tenets asserted by the CLSCompliantAttribute are good best practices. Do you have encountered / know of cases where YAGNI outweighs the best practices? ...

Understanding CLS compliance and correct code

I've attempted to create an abstracted control to manage some of the state in our application, however have run a foul of some CLS issues and was hoping that someone could provide some insight. I have an Enumeration as such: <Flags()> _ Public Enum FormState Read = 1 Edit = 2 Insert = 4 End Enum And a class as such: Publ...

Argument type 'FluentNHibernate.Mapping.IProperty' is not CLS-compliant

Name is not compliant? Layout? What? Do you have ideas what exactly could generate this message? Any ideas are welcome. I have bunch of such warning. Actually, I am open to remove CLSCompliant(true), but I want to know root cause. ...

Setting CLS compliance for a .NET assembly

Setting CLS compliance for an entire .NET assembly is possible. But how is it actually done? E.g. with Visual Studio 2008? ...

CLSCompliant(true) drags in unused references

Can anyone explain the following behavior? In summary, if you create multiple CLS compliant libraries in Visual Studio 2008 and have them share a common namespace root, a library referencing another library will require references to that library's references even though it doesn't consume them. It's pretty difficult to explain in a si...

A definite guide to API-breaking changes in .NET

I would like to gather as much information as possible regarding API versioning in .NET/CLR, and specifically how API changes do or do not break client applications. First, let's define some terms: API change - a change in the publicly visible definition of a type, including any of its public members. This includes changing type and mem...

CIL,CLS,CTS IN .NET

what is the CIL,CTS,CLS in .net and what is the difference among them? ...

base type is not CLS-compliant in Third Party Control

I have a control that I purchased. When I tried to inherit from the control I get this message: Warning: 'MyNamespace.MyFile': base type 'Mooseworks.UI.MwTextBox' is not CLS-compliant Is there any way around this besides asking the vendor of my control to make their control CLS compliant? ...

CLS compliant types in P/Invoke helper assembly

Having a separate helper assembly containing only P/Invoke declarations for legacy 3rd party components, I wonder which of these two ways is The Better One™ if the assembly must be marked CLS compliant: Use Int32 in a public P/Invoke declaration where the unmanaged declaration has unsigned int. Use UInt32 in an internal P/Invoke declar...

Is there a way to use IronPython objects and functions (compiled into an assembly) from C# code?

IronPython.net documentation says the MSIL in the assembly isn't CLS-compliant, but is there a workaround? ...

Looking for the exact list of possible MethodAttributes.SpecialName.

I am aware of ctor, cctor, property/indexer prefix: get_, set_, event management prefix: add_, remove_. I have seen a raise_ prefix once or twice (do not remember where). Does a definitive list exists at the .Net level (ECMA spec.)? If yes where is it? Is it an "open list" so that any (new) language can define them for its (future) nee...