CA1014 Mark 'some.dll' with CLSCompliant(true) error message with StyleCop of VS2010

prosseek picture prosseek · May 23, 2011 · Viewed 9k times · Source

When I run StyleCop, I got this error message saying that I need to Mark the dll with CLSCompliant(true).

What is this? How can I set the Mark the dll with CLSCompliant(true)?

Error   4   CA1014 : Microsoft.Design : 
Mark 'SOMETHING.dll' with CLSCompliant(true) because it exposes externally 
                     visible types. ModelsimCommunicator

Answer

JaredPar picture JaredPar · May 23, 2011

To mark the DLL as CLS compliant do the following in the root namespace.

[assembly: CLSCompliant(true)]

Note: This error is coming from FxCop not StyleCop. FxCop errors are prefixed with CA while StyleCop uses the SA prefix