Davaris Posted July 9, 2010 Share Posted July 9, 2010 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? Quote 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 More sharing options...
TylerH Posted July 9, 2010 Share Posted July 9, 2010 http://www.devarticles.com/c/a/C-Sharp/Making-Your-Code-CLS-Compliant/ The Vector classes contain overloaded operators, which are not CLS Compliant. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Davaris Posted July 9, 2010 Author Share Posted July 9, 2010 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. Quote 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 More sharing options...
Recommended Posts
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.