Jump to content

Argument type <> is not CLS compliant


Davaris
 Share

Recommended Posts

I'm using Wintellect's Power Collections for .NET

 

http://powercollections.codeplex.com/releases/view/6863

 

and am getting warning messages like:

 

Argument type 'Leadwerks.Vector3' is not CLS compliant

 

whenever I declare a Leadwerks type.

 

I found the cause is this line in Wintellect's algorithms file:

 

// Everything should be CLS compliant.
[assembly: CLSCompliant(true)]

 

Does anyone know what the problem is? Is it an issue with Leadwerks itself, or is it the C# wrapper?

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

http://www.devarticles.com/c/a/C-Sharp/Making-Your-Code-CLS-Compliant/

 

The Vector classes contain overloaded operators, which are not CLS Compliant.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

From what I have read, you can mark parts of the code to be non compliant. I don't know if it can still be used with these collections though.

 

http://www.devarticles.com/c/a/C-Sharp/Making-Your-Code-CLS-Compliant/

 

 

You can apply the CLSCompliant attribute on an assembly (or a program element) and have the compiler check if your code is CLS (Common Language System) compliant. This means it works properly when consumed by other .NET languages. For example, you can place the following attribute on your .NET AssemblyInfo.cs files:

 

[assembly: CLSCompliant(true)]

 

 

Some of the things the compiler checks:

 

Class and member names cannot differ only by case. For example, you can't have one property named Counter and another named counter. This is important for cross-language compatibility since VB .NET isn't case sensitive.

 

Overloaded class methods cannot differ only by out or ref parameter designations.

 

Publicly exposed members cannot start with an underscore ( _ ).

 

Operators can't be overloaded

 

Unsigned types can't be part of the public interface of a class

 

Unfortunately, although you can apply the CLSCompliant attribute in VB .NET, the VB .NET compiler doesn't check for CLS compliance. In VB.NET 2005, this has apparently been fixed.

Win 7 Pro 64 bit

AMD Phenom II X3 720 2.8GHz

GeForce 9800 GTX/9800 GTX+

4 GB RAM

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...