visual-studiovisual-studio-2010dllstylecopcls-compliant

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


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

Solution

  • 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