Questions tagged [cls-compliant]

The CLS (Common Language Specification) is a set of constraints on APIs and a complementary set of requirements on languages. If a library is CLS-compliant (i.e. adheres to all the constraints), then any CLS-compliant language can use that API. Conversely, a CLS-compliant language is guaranteed to be able to use any CLS-compliant library. (Int32 is an example of a CLS-compliant type, so CLS guarantees it's safe for library writers to use it in their APIs.)

103 questions
1
vote
1 answer

Using non-cls compliant types in abstract methods

I have an external assembly that I use, and for whatever reason it does not specify CLS Compliance. So, this causes a lot of my code to be marked as non-cls compliant. The problem I'm running into is the following: public abstract class SomeClass { …
myermian
  • 31,823
  • 24
  • 123
  • 215
1
vote
0 answers

How to fix CLS-Compliant in autogenerated XSD code

We have a data set and one of the columns is a VB keyword. The generated code automatically put an underscore in front of it for the property name in *.designer.vb. This is giving a warning for CLS-Compliance. Now we would like to remove warnings…
dwidel
  • 1,264
  • 1
  • 12
  • 22
0
votes
2 answers

Assembly code not working with nasm

i am learning assembly as part of my course. This code is to clear screen and then type 4529. It is quite old-school style, though our teacher explains things very well so i will stick with this style of code instead of using HLA or macros etc.. Now…
Alter Ego
  • 39
  • 3
  • 13
0
votes
1 answer

Implications of protected variable starting with _ and CLSCompliant attribute

We have some C# code where there are protected variables that have been named with underscores protected string _name; public string Name { get { return _name; } set { _name = value; } } This generates CLS compliance…
lgaud
  • 2,430
  • 20
  • 30
0
votes
1 answer

GCP Console error: System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

I tired to run the command on GCP Shell " systemctl status cis-level1" to check the complaince status of my GCP enviornment with CIS benchmark and got the error in screenshot ![System has not been booted with systemd as init system (PID 1). Can't…
0
votes
0 answers

Why does an explicit interface implementation with varying case prevent a class from being CLS compliant?

Consider the following example: [assembly:CLSCompliant(true)] public interface I { void FrobnicateSQL(); } public class C : I { public void FrobnicateSql() { } // * void I.FrobnicateSQL() { } } The line marked with * yields the…
Heinzi
  • 167,459
  • 57
  • 363
  • 519
0
votes
2 answers

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.
Mike Chaliy
  • 25,801
  • 18
  • 67
  • 105
0
votes
1 answer

Setting the CLSComplaint attribute to true shows error with VisualStudio 2022

I have set the CLSComplaint attribute to true but i am facing an error with the public properties used. The same code works fine with VS10 but only showing error with VS2022. [assembly: CLSCompliant(true)] Showing error with the Public property and…
0
votes
0 answers

If enums are not CLS-compliant what can I use instead?

Enums are making some of my assemblies not-CLS-compliant. I know they shouldn't be public because every language defines them differently. But if I cannot hide them and use them internally, what can I use instead of an enum?
Maurice Klimek
  • 930
  • 5
  • 13
  • 48
0
votes
1 answer

Does C# CLS doesn't cover passing ulong parameter?

The folloging is from a book on C#. To illustrate, the following Add() method is not CLS-compliant, as the parameters and return values make use of unsigned data (which is not a requirement of the CLS): class Calc { // Exposed unsigned data is not…
zar
  • 11,361
  • 14
  • 96
  • 178
0
votes
0 answers

What are the potential impacts of CLS Non-Compliance?

I recently started a new job with a new code base, and much to my horror the first time I compiled the new code I discovered that there were more than 1200 warnings present in the compiler output. Previously, I was working on medical device…
Catachan
  • 190
  • 2
  • 12
0
votes
1 answer

Proxy class generated from WSDL is having CLS compliant error

I have tried to generate a proxy class from WSDL file given using .net 2003. When i tried to add this class file to my project which is in .net 2003, Its giving error in proxy class like "Identifier is not in case CLS compliant code" What might be…
Hemalatha
  • 1
  • 2
0
votes
0 answers

Is \t CLS compliant?

I am trying to gradually migrate my VB Dot Net code to use only CLS compliant language elements so that the eventual switch to C# is less painful. Currently, I am using Microsoft.VisualBasic.vbTab and am looking for the CLS equivalent. Thanks.
Keith Howard
  • 347
  • 4
  • 12
0
votes
1 answer

CLS compat Public properties naming validation routine

Im working on a system that allows one to define data types (types that have only public properties) on the fly (undercovers using reflection.emit), i want my new types to also be CLS compliant, what would a validator that validates member names…
almog.ori
  • 7,839
  • 1
  • 35
  • 49
0
votes
2 answers

How can I apply one or more attributes to all classes in a project?

How can I apply an attribute to all classes in a particular project?! And is it enough to apply CLSCompliant attribute to just one class or do I have to apply to all classes? Thanks for your answers...
Dr TJ
  • 3,241
  • 2
  • 35
  • 51