Our virtual home

NameValueCollection not CLSCompliant

Today I stumbled over a framework v1.1 issue related to the wellknown System.Collections.Specialized.NameValueCollection. I used it in a public interface as a return parameter and somewhere again as method parameter within a assembly marked with the attribute CLSCompliant(true). The MSDN docs are silent about CLS compliance in that case and I figured out, it is not compliant! Got compile errors like this:

ADSIAuthenticationProvider.cs(31,37): error CS3001: Argument type 'PROCOS.Components.Authentication.Shared.IAuthenticationConfiguration' is not CLS-compliant

or

ADSIAuthenticationProvider.cs(44,10): error CS3002: Return type of 'PROCOS.Components.Authentication.Services.ADSIAuthenticationProvider.Authenticate(System.Collections.Specialized.NameValueCollection)' is not CLS-compliant

Both are NameValueCollection types. So: is it a bug? I did not found a notice about looking around with google, so I think I have to change my type(s) to a other one that is hopefully CLS compliant.

» Similar Posts

  1. Strange XSL Transform Exception - figured out
  2. .NET Issue with Vista icons
  3. How to prevent the configuration file watcher thread in Microsoft Enterprise Library 3.1

» Comments

  • philadelphia metal roofing avatar

    Hello. I just wanted to give a quick greeting and tell you I enjoyed reading your material

    philadelphia metal roofing — Oktober 28, 2005 7:14
  • Comments are closed