473,387 Members | 1,798 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,387 software developers and data experts.

CLSCompliant attribute default

Is the default 'false' for the CLSCompliant attribute at the assembly
level ? Are there any tools to check for CLS compliance for the various
NET languages ?

Nov 22 '05 #1
5 3012

"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Is the default 'false' for the CLSCompliant attribute at the assembly
level ? Are there any tools to check for CLS compliance for the various
NET languages ?
The first part you could have found on your own, from msdn:
If no CLSCompliantAttribute is applied to a program element, then by
default:

a.. The assembly is not CLS-compliant.
b.. The type is CLS-compliant only if its enclosing type or assembly is
CLS-compliant.
c.. The member of a type is CLS-compliant only if the type is
CLS-compliant.
as for the second part, fxcop[1] will run across assemblies and give you
alot of information about the assembly, including naming and atleast some
cls compliance. Currently, any of MS's design guidelines that are revised
and posted(usually via Brad Abrams) contain suggestions for additional rules
to fxcop. It can also be extended to add your own rules.

1: http://www.gotdotnet.com/team/fxcop/


Nov 22 '05 #2
Daniel O'Connell wrote:
"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Is the default 'false' for the CLSCompliant attribute at the assembly
level ? Are there any tools to check for CLS compliance for the
various NET languages ?
The first part you could have found on your own, from msdn:
If no CLSCompliantAttribute is applied to a program element, then by
default:

a.. The assembly is not CLS-compliant.
b.. The type is CLS-compliant only if its enclosing type or
assembly is CLS-compliant.
c.. The member of a type is CLS-compliant only if the type is
CLS-compliant.


That is a bit confusing, but I have found the area in MSDN which explains
it. Obviously if no CLSCompliantAttribute is applied to a specific program
element, the assembly could still be CLS-compliant if the
CLSCompliantAttribute is applied to the assembly, so "a." is incorrect.
Furthermore if instead the above means "If no CLSCompliantAttribute is
applied to any program element", which would make "a." correct, then "b." or
"c." is irrelevant, but I don't think that is what it means. However, I do
gather from the above that the default for CLS compliance at the assembly
level is 'false', which is what I wanted to know from the original question.
as for the second part, fxcop[1] will run across assemblies and give
you alot of information about the assembly, including naming and
atleast some cls compliance. Currently, any of MS's design guidelines
that are revised and posted(usually via Brad Abrams) contain
suggestions for additional rules to fxcop. It can also be extended to
add your own rules.

1: http://www.gotdotnet.com/team/fxcop/


Thanks for the info on fxcop. I was not aware of this program and what it
does.
Nov 22 '05 #3

"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Daniel O'Connell wrote:
"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Is the default 'false' for the CLSCompliant attribute at the assembly
level ? Are there any tools to check for CLS compliance for the
various NET languages ?
The first part you could have found on your own, from msdn:
If no CLSCompliantAttribute is applied to a program element, then by
default:

a.. The assembly is not CLS-compliant.
b.. The type is CLS-compliant only if its enclosing type or
assembly is CLS-compliant.
c.. The member of a type is CLS-compliant only if the type is
CLS-compliant.


That is a bit confusing, but I have found the area in MSDN which explains
it. Obviously if no CLSCompliantAttribute is applied to a specific program
element, the assembly could still be CLS-compliant if the
CLSCompliantAttribute is applied to the assembly, so "a." is incorrect.
Furthermore if instead the above means "If no CLSCompliantAttribute is
applied to any program element", which would make "a." correct, then "b."

or "c." is irrelevant, but I don't think that is what it means. However, I do
gather from the above that the default for CLS compliance at the assembly
level is 'false', which is what I wanted to know from the original question.


By my understanding, an assembly can be considered CLSCompliant if all of
its member types are CLSCompliant, however I'm not entirely sure, I
would(and do) simply play it safe and apply CLSCompliant liberally.
as for the second part, fxcop[1] will run across assemblies and give
you alot of information about the assembly, including naming and
atleast some cls compliance. Currently, any of MS's design guidelines
that are revised and posted(usually via Brad Abrams) contain
suggestions for additional rules to fxcop. It can also be extended to
add your own rules.

1: http://www.gotdotnet.com/team/fxcop/


Thanks for the info on fxcop. I was not aware of this program and what it
does.

Nov 22 '05 #4
Daniel O'Connell wrote:
"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Daniel O'Connell wrote:
"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Is the default 'false' for the CLSCompliant attribute at the
assembly level ? Are there any tools to check for CLS compliance
for the various NET languages ?

The first part you could have found on your own, from msdn:
If no CLSCompliantAttribute is applied to a program element, then by
default:

a.. The assembly is not CLS-compliant.
b.. The type is CLS-compliant only if its enclosing type or
assembly is CLS-compliant.
c.. The member of a type is CLS-compliant only if the type is
CLS-compliant.


That is a bit confusing, but I have found the area in MSDN which
explains it. Obviously if no CLSCompliantAttribute is applied to a
specific program element, the assembly could still be CLS-compliant
if the CLSCompliantAttribute is applied to the assembly, so "a." is
incorrect. Furthermore if instead the above means "If no
CLSCompliantAttribute is applied to any program element", which
would make "a." correct, then "b." or "c." is irrelevant, but I
don't think that is what it means. However, I do gather from the
above that the default for CLS compliance at the assembly level is
'false', which is what I wanted to know from the original question.


By my understanding, an assembly can be considered CLSCompliant if
all of its member types are CLSCompliant, however I'm not entirely
sure, I would(and do) simply play it safe and apply CLSCompliant
liberally.


One could always mark the assembly itself as CLSCompliant(true) I believe,
and then all enclosing types, meaning all the types in the assembly, become
CLSCompliant unless marked otherwise. I am not sure how one does this in the
assembly file but I am guessing it is just another attribute added to the
file.
Nov 22 '05 #5

"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:uV**************@tk2msftngp13.phx.gbl...
Daniel O'Connell wrote:
"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Daniel O'Connell wrote:
"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
> Is the default 'false' for the CLSCompliant attribute at the
> assembly level ? Are there any tools to check for CLS compliance
> for the various NET languages ?

The first part you could have found on your own, from msdn:
If no CLSCompliantAttribute is applied to a program element, then by
default:

a.. The assembly is not CLS-compliant.
b.. The type is CLS-compliant only if its enclosing type or
assembly is CLS-compliant.
c.. The member of a type is CLS-compliant only if the type is
CLS-compliant.

That is a bit confusing, but I have found the area in MSDN which
explains it. Obviously if no CLSCompliantAttribute is applied to a
specific program element, the assembly could still be CLS-compliant
if the CLSCompliantAttribute is applied to the assembly, so "a." is
incorrect. Furthermore if instead the above means "If no
CLSCompliantAttribute is applied to any program element", which
would make "a." correct, then "b." or "c." is irrelevant, but I
don't think that is what it means. However, I do gather from the
above that the default for CLS compliance at the assembly level is
'false', which is what I wanted to know from the original question.

By my understanding, an assembly can be considered CLSCompliant if
all of its member types are CLSCompliant, however I'm not entirely
sure, I would(and do) simply play it safe and apply CLSCompliant
liberally.


One could always mark the assembly itself as CLSCompliant(true) I believe,
and then all enclosing types, meaning all the types in the assembly,

become CLSCompliant unless marked otherwise. I am not sure how one does this in the assembly file but I am guessing it is just another attribute added to the
file.
Yeah, generally in AssemblyInfo, for C# its [assembly: CLSCompliant(true)].
I think the rules apply when there is no CLSCompliant rule attached to the
assembly. I will look through the standards later on this issue as well.

Nov 22 '05 #6

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

Similar topics

2
by: Gabriel Genellina | last post by:
Hi In the following code sample, I have: - a Worker class, which could have a lot of methods and attributes. In particular, it has a 'bar' attribute. This class can be modified as needed. - a...
2
by: Malcolm Dew-Jones | last post by:
Hello What is the correct way to associate the attributes with the tag if the tag has a name space associated with it and the attribute doesn't have a name space? i.e. <mytag
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
10
by: Edward Diener | last post by:
Is the default 'false' for the CLSCompliant attribute at the assembly level ? Are there any tools to check for CLS compliance for the various NET languages ?
2
by: Bill Cohagan | last post by:
In my app I'm validating an XML file against an XSD which contains several attribute default value specifications. I'm performing the validation via an xml document load() using a...
12
by: Stefano | last post by:
Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What...
2
by: Brett Romero | last post by:
I'd like to mark an entire assembly as CLS compliant. The examples I have seen say to put this reference just outside of any class under "using System;". Can this go into any file outside...
2
by: Nicolas | last post by:
Hi everybody... In Xerces 2.7.0 it is explicitly stated that, no matter how one removes an attribute (attList->removeNamedItem, attList->removeNamedItemNS, domElement->removeAttributeNode,...
5
by: Soledad Vel | last post by:
Hi All, i write this code: var sliderwidth=100; var sliderheight = 100; var div1 = document.createElement('div'); div1.setAttribute('id','d5'); div1.setAttribute('style',...
5
by: AdSR | last post by:
Hi, I'm having a problem with the Amara toolkit. Try this: >>> from amara import binderytools >>> raw = '<pq:test xmlns="http://example.com/namespace" xmlns:pq="http://pq.com/ns2"/>' >>> rwd...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.