Where to put [assembly: CLSCompliant(true)]?

C

chris martin

I'd like to mark an entire assembly as CLS compliant. The examples I
have seen say to put this reference

[assembly: CLSCompliant(true)]

just outside of any class under "using System;". Can this go into any
file outside of class declarations?

References:
http://www.devarticles.com/c/a/C-Sharp/Making-Your-Code-CLS-Compliant/
http://www.codeproject.com/csharp/effectivecspart1.asp#item12

Thanks,
brettr

I would think that the attribute belongs in the AssemblyInfo file. But, it's
legal to put it right after the using statements in any csharp file
 
T

Tim Wilson

You can place this attribute anywhere outside the type definitions and
namespaces, somewhere in the "white space". As an example, I usually throw
this attribute in the AssemblyInfo.cs file since this file by default
contains other assembly-level attributes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top