Is this an issue? - base type 'Cirrious.CrossCore.Converters.MvxValueConverter<bool,bool>' is not CLS-compliant

StackOverflow https://stackoverflow.com/questions/22314377

  •  12-06-2023
  •  | 
  •  

Question

I have a portable class library that I am using MvvmCross in. I thought it would be good to centralise various MvxValueConverter classes into this library as they will be used extended or used by different platforms/dlls.

For instance I created the class:-

namespace MyCompany.Core.ValueConverters
{
  public class InverseBoolValueConverter : MvxValueConverter<bool, bool>
  {
    protected override bool Convert(bool value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      return !value;
    }
  }
}

The problem I am seeing however is that the output is throwing the following warning:-

warning CS3009: 'MyCompany.Core.ValueConverters.BoolValueConverter': base type 'Cirrious.CrossCore.Converters.MvxValueConverter' is not CLS-compliant.

I guess I am not sure if this is an issue or something that I can ignore and secondly - why is it not CLS complaint?

Any help would be appreciated.

Kind regards

Alan.

Was it helpful?

Solution

My guess is simply that you have [assembly:CLSCompliant(true)] in your assembly while MvvmCross doesn't have that set - see Base type is not CLS-compliant, what reasons of this warning?

If your project does care about interop with other languages and about strict CLS compliance, then there is a lot of info on it at http://msdn.microsoft.com/en-us/library/12a7a7h3(v=vs.110).aspx#Generics and you can find more about it here by including the C# and cls-compliant tag - e.g. https://stackoverflow.com/questions/tagged/cls-compliant

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top