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
0
votes
1 answer

Assigning IMappingEngine in constructor causes mapping exception when mapping only when running from unit test

I have an unit test - where I do AutoMapperConfiguration in setup. I then set IMappingEngine as private property in the constructor in my class where I actually do mapping. Unit test fails if I use this property, but using the static method from…
ruffen
  • 1,695
  • 2
  • 25
  • 51
0
votes
0 answers

Why byte is CLS compliant and sbyte not?

Why unsigned byte is CLS compliant instead of the signed byte ? All other unsigned types are are not CLS compliant, yet it is just the opposite on bytes. sbyte x = 1; //NOT CLS Compliant byte y = 1; //CLS Compliant
Gabriel Molter
  • 333
  • 2
  • 10
0
votes
1 answer

CLS-Compliant issue

I have the following property defined. MyLibrary.PumpSignal is an enum as follows: Public Enum PumpSignal As Integer PumpOff = 0 PumpOn = 1 End Enum Then I have another class with a property of the PumpSignal type. Property PumpState()…
daustin
  • 603
  • 1
  • 6
  • 16
0
votes
1 answer

Type of member is not CLS-compliant

Using Visual Studio 2008 and VB.Net: I have a working web app that uses an ASMX web service which is compiled into its separate assembly. I have another class library project compiled as a separate assembly that serves as a proxy to this web…
John Adams
  • 4,773
  • 25
  • 91
  • 131
0
votes
1 answer

How to make Public MySQLDataReader CLS-Compliant?

I have a project that is CLS-Compliant except one variable declaration which is confusing me how to correct. I have a class called MySQL, summed up it looks like: public class mysql implements idisposable private connection as new…
Jeff
  • 1,609
  • 3
  • 20
  • 25
0
votes
4 answers

interface not implemented error when signing C# assembly

I've been trying to sign an assembly and getting this error: 'Utils.Connection' does not implement interface member 'Interfaces.IConnection.BugFactory()'. 'Utils.Connection.BugFactory()' cannot implement 'Interfaces.IConnection.BugFactory()'…
Sarah Vessels
  • 30,930
  • 33
  • 155
  • 222
0
votes
1 answer

Is it true that for all .NET operator overload methods must be public and static?

Quoted from C# From CLR The CLR specification mandates that operator overload methods be public and static methods. I checked ECMA-335, but couldn't find any evidence. So far I know it is true for C# and F#. Is it true for all CLS-compliant…
colinfang
  • 20,909
  • 19
  • 90
  • 173
0
votes
1 answer

Class is CLS Compliant to .NET but not in Mono

I had to build my own Version class. In .NET it's CLS Compliant but in Mono its not for some reason. Any ideas why? [Serializable] public class Version : ICloneable, IComparable, IComparable, IEquatable { private int major; …
shmuelie
  • 1,205
  • 1
  • 9
  • 24
0
votes
3 answers

What could go wrong if we don't use CLS?

I'm writing a framework, and we want it to be available from C#,C++, VB. We are not stricted to any other languages for now. But we have some problems in using CLS (we have to use unsign's etc.). Can you give some real problems that appear if we are…
Archeg
  • 8,364
  • 7
  • 43
  • 90
0
votes
1 answer

ASP.net build error: Identifier '__ASP' is not CLS-compliant

i am getting error when building an ASP.net web-site: Identifier '__ASP' is not CLS-compliant Nowhere in my code is there the identifier __ASP. i know why __ASP is not CLS-compliant (it starts with an _). What i need to figure out who is emitting…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
0
votes
2 answers

How do I handle CLS-compliant within a Web Reference?

I am turning on [assembly: System.CLSCompliant(true)] inside the assemblies of my C# solution. I am now getting a few warnings inside the generated code for a SharePoint Web Service. Here is one of the methods that are not CLS-compliant: ///…
Keith Sirmons
  • 8,271
  • 15
  • 52
  • 75
-1
votes
1 answer

Getting "Argument type 'StreamSocket' is not CLS-compliant" warning on build

I'm developing a UWP library which has public properties and method parameters of StreamSocket class. However, I'm getting "StreamSocket is not CLS-compliant" warning. What's so special there that Microsoft decided to leave the respective assembly…
Alex
  • 2,469
  • 3
  • 28
  • 61
-2
votes
2 answers

How do I find all the non CLS-compliant statements in my .NET code?

How do I find all the non CLS-compliant statements in my .NET code? Can Visual Studio 2015 compiler do it? How do I find non CLS-compliant warnings? I've checked StyleCop ReSharper extension and ndepend without success. What I am after is to find…
abenci
  • 8,422
  • 19
  • 69
  • 134
1 2 3 4 5 6
7