FXCOP CLSCompliant
-
How can I be sure that an assembly is CLS-compliant?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
How can I be sure that an assembly is CLS-compliant?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001Do you mean, apart from checking if it's got the CLSCompliant(true) attribute?
Regards, Lev
-
Do you mean, apart from checking if it's got the CLSCompliant(true) attribute?
Regards, Lev
Yes. FXCOP says I should use the attribute if the assembly is CLSCompliant, but how do I know if it is?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Yes. FXCOP says I should use the attribute if the assembly is CLSCompliant, but how do I know if it is?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001I think you have two options: 1. Add the [assembly:CLSCompliant(true)] attribute to the assembly, and see what are the compiler's errors/warnings 2. Or if you need to do it in code, look at the CLS compliance restrictions in the ECMA 335 standard[^] (it's got a lot of info on CLS compliance) and check for these using Microsoft.Cci (the fxcop's backend) or Mono.Cecil
Regards, Lev
-
How can I be sure that an assembly is CLS-compliant?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001My understanding is that you should mark the attribute if you intend it to be CLS compliant and then compiler will let you know if it isn't. Look here for more info. -Joe.
-
I think you have two options: 1. Add the [assembly:CLSCompliant(true)] attribute to the assembly, and see what are the compiler's errors/warnings 2. Or if you need to do it in code, look at the CLS compliance restrictions in the ECMA 335 standard[^] (it's got a lot of info on CLS compliance) and check for these using Microsoft.Cci (the fxcop's backend) or Mono.Cecil
Regards, Lev
Lev Danielyan wrote:
Add the [assembly:CLSCompliant(true)] attribute to the assembly, and see what are the compiler's errors/warnings
Yep, I did that and didn't get any errors or warnings.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
My understanding is that you should mark the attribute if you intend it to be CLS compliant and then compiler will let you know if it isn't. Look here for more info. -Joe.
That's what I said in my previous post. But I think it is more challenging to analyze the assembly and figure out if it is CLS compliant.
Regards, Lev
-
That's what I said in my previous post. But I think it is more challenging to analyze the assembly and figure out if it is CLS compliant.
Regards, Lev
"More challenging" = "more time-consuming".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Lev Danielyan wrote:
Add the [assembly:CLSCompliant(true)] attribute to the assembly, and see what are the compiler's errors/warnings
Yep, I did that and didn't get any errors or warnings.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001Then you are safe to mark it with CLSCompliant attribute :)
Regards, Lev
-
"More challenging" = "more time-consuming".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001Right, but it will give more knowledge on the guts of .Net, and eventually you will be writing compliant code right away (of course in those cases when you actually can make your assembly compliant), it can make some time savings as opposed to marking your stuff with attribute and fixing errors (especially for large products). But this is just IMHO ;)
Regards, Lev
-
Yes. FXCOP says I should use the attribute if the assembly is CLSCompliant, but how do I know if it is?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001