"Argument type 'ushort' is not CLS-compliant"


i have class opens usb device using pid , vid.  these values traditionally unsigned shorts (16bit unsigned).  made static function creating device uint16 arguments , compiler warning telling me uint16s not cls compliant.  ("argument type 'ushort' not cls-compliant")  i've used them in other functions without warning.  what's wrong this?

public class device : system.idisposable
{
    public static device opendevice(uint16 vid, uint16 pid)
    {}
}

it means not cls compliant languages have support type. therefore must either mark assembly being not cls compliant or use data type int32:



.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

Azure DocumentDB Owner resource does not exist

SQL Server 2008 - High Memory Usage