FxCop: [assembly: CLSCompliant(true)]

FxCop: [assembly: CLSCompliant(true)]

Old forum URL: forums.lhotka.net/forums/t/436.aspx


skagen00 posted on Wednesday, June 21, 2006

We are attempting to adhere to FxCop, and when I have tried to tag one of my libraries with the CLSCompliant flag, since it utilizes CSLA classes and the CSLA project is not marked as CLSCompliant, I get a slew of warnings.

It appears that there is no problem with tagging CSLA with a CLSCompliant tag. Is there any reason why it shouldn't be? Is the general concept that if a project is marked with the CLSCompliant flag that it would be fully extensible in other languages other than the one it was written in? That it adheres to the common language specification?

If not, could someone educate me? Thanks!

 

ajj3085 replied on Wednesday, June 21, 2006

This came up on another thread; I think that the next version of 2.0 will have the CLSComplaint(true).

I believe Rocky said that VB automatically adds that in on compile, so it shouldn't be a problem just to add it it.

I was a bit suprised though, because according to the docs not having that attribute should be equivlent to [assembly: CLSComplaint( false )].

Andy

skagen00 replied on Wednesday, June 21, 2006

Here's something interesting that I just found...

"Dan Fernandez blogs a reminder that generics are not CLS compliant in the .NET Framework 2.0. Apparently to make them so would put too large an onus on CLS language developers."

From this statement, I realize why some of my framework classes (I have a couple generics in my framework DLL that inherit from CSLA).

From the statement, though, it makes me wonder how CSLA could be marked as CLSCompliant?

 

ajj3085 replied on Wednesday, June 21, 2006

skagen00:
"Dan Fernandez blogs a reminder that generics are not CLS compliant in the .NET Framework 2.0. Apparently to make them so would put too large an onus on CLS language developers."

From this statement, I realize why some of my framework classes (I have a couple generics in my framework DLL that inherit from CSLA).

From the statement, though, it makes me wonder how CSLA could be marked as CLSCompliant?

Check that blog again; it shows an update, Generics ARE CLS complaint.

jwooley replied on Wednesday, June 21, 2006

I tried converting CSLA 1.5 up to .Net 2.0 as I didn't want to wait on Rocky's implementation a while back. I was surprised how many FxCop/CodeAnalysis issues came up in the framework at that point. I haven't checked the 2.0 release against it to know how much better it is at this point from that standpoint.

Jim
http://devauthority.com/blogs/jwooley/default.aspx

skagen00 replied on Wednesday, June 21, 2006

I'm finding a lot just in my class related to uncallable code (eventually called when reflection is used in the dataportal).

ajj3085 replied on Wednesday, June 21, 2006

You should probably tag them like Rocky did in 2.0 to suppress the FxCop warnings.

Copyright (c) Marimer LLC