Is the new feature of C# 4.0 – “Optional Parameters” CLS-Compliant?

Optional arguments are “sort-of” CLS-compliant. Methods with optional arguments are legal and can be successfully compiled with the CLSCompliant attribute, but callers of those methods don’t necessarily need to take account of the default parameter values or the optional attribute. (In which case those methods would behave in exactly the same way as standard methods, … Read more

Setting CLS compliance for a .NET assembly

Visual Studio adds a directive for the compiler, and the compiler checks the code for some more strict rules than in the native programming language. You can add the CLS compliant attribute to all your project by adding the assembly level attribute [assembly: CLSCompliant(true)] anywhere in your project, generally in the assemblyinfo.cs file. If the … Read more

Why are unsigned int’s not CLS compliant?

Not all languages have the concept of unsigned ints. For example VB 6 had no concept of unsigned ints which I suspect drove the decision of the designers of VB7/7.1 not to implement as well (it’s implemented now in VB8). To quote: http://msdn.microsoft.com/en-us/library/12a7a7h3.aspx The CLS was designed to be large enough to include the language … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)