473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

System types not CLS compliant?

Hi there,

I keep getting warnings appear in VS about a class of mine being non-cls
compliant.

The strange thing is that it only exposes system types, the properties
it exposes are as follows....

name String
company String
email String
appGUID String
version String

And it has 1 constructor that asks for all of said properties + 1 more
that is not exposed, which is of Boolean type.

Why on earth does VS keep telling me this isn't CLS compliant?

Nick.
Jan 25 '07 #1
2 1095
"NickP" <ni**@nick.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP03.phx.gbl...

The strange thing is that it only exposes system types, the properties
it exposes are as follows....

name String
company String
email String
appGUID String
version String

And it has 1 constructor that asks for all of said properties + 1 more
that is not exposed, which is of Boolean type.

Why on earth does VS keep telling me this isn't CLS compliant?
What is the excact error and what is the exact line of code?
Jan 25 '07 #2
Hi Fabio,

"Type of '<myclassesname>' is not CLS-compliant"

This occured any line it was used outside of the assembly it was
created.

I know for a fact that this class is CLS-compliant as I am using only
System value types. Anyway, it's not an issue now, I have managed to stop
it complaining by stick a CLSCompliant attribute onto the class.

Everything works as expected now.

I can only presume this is a SP1 bug or somesuch, and can join the
others that I have encountered recently

The class looked pretty much like this....

------------

Class myclassisclscompliantsoshutupmoaning

Private cStrName as string = string.empty

Public property name() as string
...normal property body
End property

Public sub new(Byval iOtherParameter as Boolean, _
Byval iName as String)

If(iOtherParameter)
'do other stuff with iName before setting property
Else
cStrName = iName
End if
End sub

End Class

------------

Anyways, thanks for your time.

Nick.

"Fabio Z" <zn*******@virgilio.itwrote in message
news:ON**************@TK2MSFTNGP03.phx.gbl...
"NickP" <ni**@nick.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP03.phx.gbl...

> The strange thing is that it only exposes system types, the
properties it exposes are as follows....

name String
company String
email String
appGUID String
version String

And it has 1 constructor that asks for all of said properties + 1 more
that is not exposed, which is of Boolean type.

Why on earth does VS keep telling me this isn't CLS compliant?

What is the excact error and what is the exact line of code?

Jan 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
9
by: Gonçalo Rodrigues | last post by:
Hi all, I have a few questions on primitive types that I will divide in two main questions. I realize that some of these questions -- especially 2. below -- are not directly related to C++ as a...
93
by: Matt | last post by:
Hi folks. Can you help with some questions? I gather that some types supported by g++ are nonstandard but have been proposed as standards. Are the long long and unsigned long long types still...
5
by: Mitchell S. Honnert | last post by:
I'm thinking about adding unsigned types, like UShort and UInt, to a VB.NET library that I published which edits ID3 tag information. It would make the interface much more clean to have some...
9
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a...
3
by: Jake Barnes | last post by:
37 Signals has built some awesome software with some features I wish I knew how to imitate. When I'm logged into my page (http://lkrubner.backpackit.com/pub/337271) any item that I mouseOver I'm...
17
by: Christian Wittrock | last post by:
Hi, What does ANSI C say about casting an 8 bit pointer to a 16 bit one, when the byte pointer is pointing to an odd address? I have detected a problem in the Samsung CalmShine 16 compiler. This...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
5
by: steve bull | last post by:
I have created a class with get/set methods but VS complains that the type of the variable is not CLS compliant. For example in the following code : namespace TilerSpace { public partial class...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.